【问题标题】:Exception from HRESULT: 0x8007000B, for a MatLab Compiled dllHRESULT 的异常:0x8007000B,对于 MatLab 编译的 dll
【发布时间】: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),所以我尝试将平台目标更改为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)。谁能指出我遗漏的东西。

【问题讨论】:

    标签: c# matlab dll


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-26
      • 2011-08-14
      • 2016-05-09
      • 2017-12-31
      • 1970-01-01
      • 2013-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多