sam_hsd 2019-03-09 17:57 采纳率: 0%
浏览 1393

VS2017 C#调用labview 2015 生成的Dll-报错-试图加载格式不正确的程序

Labview 生成的函数原型如下:
#include "extcode.h"
#ifdef __cplusplus
extern "C" {
#endif

/*!

  • StringTest */ void __cdecl StringTest(char String_Input[]);

MgErr __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);

#ifdef __cplusplus
} // extern "C"
#endif

调用代码:
[DllImport("TypeTest.dll", EntryPoint = "OutTest", CallingConvention = CallingConvention.Cdecl)]
public static extern double OutTest(char[] path);

static void Main(string[] args)
{

        LvDll.OutTest("Test".ToCharArray());

        Console.ReadLine();
    }

在c#中如何调用???/

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-03-09 23:48
    关注

    这个错误一般说明你的dll的架构和主程序不同,比如说x64下调用了32bit的dll,或者反之。

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料