首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#调用c的DLL文件,这个方法改如何写呢?有点迷糊

2013-03-06 
C#调用c的DLL文件,这个方法改怎么写呢?有点迷糊dllc#[解决办法] [DllImport(c的动态库.dll)]public exte

C#调用c的DLL文件,这个方法改怎么写呢?有点迷糊
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/

热点排行