【发布时间】:2016-02-10 23:46:14
【问题描述】:
我收到了一个 Matlab 编译的 .dll(针对 32 位 (x86) 系统)。我使用带有 Windows 7 的 64 位系统。我正在使用 Visual Studio IDE 制作我的应用程序并导入此 .dll。下面是代码。
[DllImport("Generate_Curve.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Generate_Curve", CharSet = CharSet.Ansi)]
我看到了类似的问题.net Framework Error (HRESULT 0x8007000B),所以我尝试将平台目标更改为x86 或Any CPU 加上Prefer 32-bit。仍然有一个错误抛出An unhandled exception of type 'System.BadImageFormatException,附加信息为An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)。谁能指出我遗漏的东西。
【问题讨论】: