“无法在C#dll中找到名为[function]的入口点”

“无法在C#dll中找到名为[function]的入口点”

问题描述:

大家好,



我们正在尝试从32位应用程序加载64位COM注册的DLL。我们得到了"无法在C#DLL中找到名为[function]的入口点"。尝试访问DLL的方法时出现异常。



我们观察到相同的32位COM注册DLL与32位应用程序一起运行正常并且能够访问方法。


$
请告诉我们如何从32位应用程序访问64位COM注册的DLL。如果有人建议使用有效的测试应用,那将非常有用。



提前致谢。

Hi All,

We are trying to load 64 bit COM registered DLL from the 32-bit application. We are getting the "Unable to find an entry point named [function] in C# DLL" exception while trying to access the method of DLL.

We have observed that same 32 bit COM registered DLL is working fine with the 32-bit application and able to access the methods.

Please let us know how we can access the 64 bit COM registered DLL from the 32-bit application. It would be really helpful if anybody suggests a working test application.

Thanks in advance.

AC#DLL并不真正公开函数。它包含数据部分中的MSIL代码。如果你想通过COM使用它,你必须重新使用本机代码。

A C# DLL does not really expose functions. It contains MSIL code in the data section. If you want to use it via COM you have to regasm to native code.

您无法从32位应用程序加载64位dll。您可以编写64位包装器exe并进行进程间通信或将dll重写为32位。

You can't load a 64bit dll from a 32 bit application. You can write a 64 bit wrapper exe and do inter-process communication or rewrite the dll to 32 bit.