C# 调用Labview的dll

来源:互联网 发布:在线语音朗读软件 编辑:程序博客网 时间:2024/05/17 04:40

        最近需要在C#中调用Labview生成的dll,无非就是非托管dll的调用,难点在于类型的转换,Labview中的类型和C#中类型的转换。

        函数原型:

        void TestFun(char Path[],CharPro[])

        调用方法:

          [DllImport("TrustSystem.dll", EntryPoint = "TestFun", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
         public static extern void TestFun([MarshalAs(UnmanagedType.LPStr)] string Path, [MarshalAs(UnmanagedType.LPStr)]string project);
         直接调用TestFun即可。

       

原创粉丝点击