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

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 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错