我有我需要在我的.NET 4.0应用程序中使用的非托管C++ API代码的dll库。但是每一个方法我尝试加载我的DLL我得到一个错误:无法加载DLL(无法找到模块HRESULT:0x8007007E)
Unable to load DLL 'MyOwn.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
我已阅读并试图Severa的解决方案,我已经在互联网上找到。实在不行..
我曾尝试使用以下方法:
[DllImport("MyOwn.dll", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs((UnmanagedType.I4))]
public static extern Int32 MyProIni(string DBname, string DBuser_pass,
string WorkDirectory, ref StringBuilder ErrorMessage);
当我尝试以下this article,当我运行这个例子(从下载的代码),它运行没有问题(使用的DLL是bin/debug文件夹)
我已经复制了我的dll(以及它依赖的所有文件到我的bin文件夹中)。
我也尝试过这种方法,但得到了同样的错误:
[DllImportAttribute(MyOwnLibDllPath, EntryPoint="TMproIni")]
[return: MarshalAs(UnmanagedType.I4)]
public static extern int MyproIni(string DBname, string DBuser_pass,
string WorkDirectory, ref StringBuilder ErrorMessage);
有什么建议?
是它可以有所有依赖的System32文件夹和我的DLL在别的地方? –