日期:2014-05-18  浏览次数:20721 次

C#引用C++库类型匹配
我C++中的函数是这样的,bool checklogin( int nCallID,const char *Name,const char pass,WORD valid);dll是voidlogin.dll
C#中引用的参数类型应该是什么啊
我现在写的是 [DllImport("voidlogin.dll", EntryPoint = "checklogin")]
 public extern static bool checklogin(Int32 id,string name,string pass,string valid)感觉不对?
不知道真确的应该怎么写

------解决方案--------------------
const char pass ?
-->const char* pass
最后一个用uint16

------解决方案--------------------
系统函数引用实例。只要参数类型不错就行了
[DllImport("kernel32.dll")]
public extern stativ void ReadProcessMemory(IntPtr handel,IntPtr address,uint[] data,int size,IntPtr read);