Base Class Library for RS232 Communications. Ref: "Serial Comm: Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications" John Hind, MSDN Magazine, Oct 2002. V1.3 February 2004. LIBRARY CommBase.dll The library redistr ibut
为了能用上原来的C++代码,只好研究下从C# 中调用DLL
首先必须要有一个声明,使用的是DllImport关键字:
包含DllImport所在的名字空间
using System.Runtime.InteropServices;
public class XXXX{
[DllImport(“MyDLL.dll")]
public static extern int mySum (int a,int b);
}
[DllImport(“MyDLL.