我在msdn 找到相关描述:
If your application uses 32-bit components, make sure that it always runs as a 32-bit application.If the Platform target property for your application project is set to AnyCPU, the compiled application can be run in either 64-bit or 32-bit mode. When it runs as a 64-bit application, the just-in-time (JIT) compiler produces 64-bit native code. If the application depends on a 32-bit managed or unmanaged component, that component will fail to load in 64-bit mode. To correct this problem, set the project's Platform target property to x86 and recompile. 关键是他娘的,我换成 x86 编译,又报找不到这个DLL文件,不能加载。这个DLL 无论扔那个环境目录下都这样。
If your application uses 32-bit components, make sure that it always runs as a 32-bit application.If the Platform target property for your application project is set to AnyCPU, the compiled application can be run in either 64-bit or 32-bit mode. When it runs as a 64-bit application, the just-in-time (JIT) compiler produces 64-bit native code. If the application depends on a 32-bit managed or unmanaged component, that component will fail to load in 64-bit mode. To correct this problem, set the project's Platform target property to x86 and recompile. 关键是他娘的,我换成 x86 编译,又报找不到这个DLL文件,不能加载。这个DLL 无论扔那个环境目录下都这样。
如果你需要大内存支持,那么可以试试写一个32位程序调用dll并公开为服务,然后这个64位程序通过进程通讯方式调用这个服务。
哪里看得到源码哟。要是能拿到源码,我直接叫人封成托管dll 了。哪有这么抓狂呀
否则必须使用一个32位系统,即使是虚拟机。
哪里看得到源码哟。要是能拿到源码,我直接叫人封成托管dll 了。哪有这么抓狂呀我说的是DLLImport的源码。
算了,你还是确定那个dll能在64位上用才捉狂吧
Unable to load DLL 'C:\\DRIVERS\\CDM8240\\GRGCDMDevDll.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
要求这个 DLL 的依赖项在 LoadLibrary 的要求路径中。
这个不需要其他的尝试。
这个原因是:原厂提供的DLL本身有问题。 唉,真坑爹啊。