C#如何调用C语言实现的dll

如题所述

using System.Runtime.InteropServices;

在 C# 中的调用写的有问题 参数类型弄错了
[DllImport("COMM.dll", EntryPoint = "RegisterOnZXTcp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
//参 数:hWnd ------- WINNTTCP窗口句柄 C#中的句柄类型为 IntPtr
//curPNo ------- 接口机的PNO 可以设为string 类型
//输 出:BOOL值,注册是否成功
public static extern bool RegisterOnZXTcp(IntPtr HWND, string curPNo);
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答