来自HRESULT的异常:0x8007000B,用于MatLab编译的dll

时间:2016-02-10 09:25:23

标签: c# matlab dll

我收到了Matlab Compiled .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),因此我尝试将平台目标更改为x86Any 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)。任何人都可以指出我错过的东西。

1 个答案:

答案 0 :(得分:0)

我收到了Matlab(Mathworks)的回答,Matlab编译器中存在一个错误。如果用Matlab编码器中的64位Matlab编译target machine or application of 32 bit,则生成的.dll很可能被破坏。解决方案是使用32位Matlab(Matlab Coder)为32位目标机器/应用程序编译dll。这个问题更多的是Matlab Coder问题。

相关问题