C#调用c的DLL文件,这个方法改怎么写呢?有点迷糊
dll
c#
------解决方案-------------------- [DllImport("c的动态库.dll")]
public extern static Int32 CommonOpen(IntPtr hwnd,string com_port);
调用时
if(CommonOpen(this.Handle,"COM1")==0)
{...
}
------解决方案--------------------要用MarshalAs属性来声明
具体参考一下
http://blog.163.com/wxfsnow@126/blog/static/1049536620117541025911/