问下这两个API在C#中该如何申明
int __stdcall LPC2400_ReadData (int siPipeNum,unsigned char *pucRcvBuf,int siReadLen,int siWaitTime)
int __stdcall LPC2400_WriteData(int siPipeNum,unsigned char *pucSendBuf,int siSendLen,int siWaitTime)
我的写法是:
[DllImport("EasyUSB2400.dll", EntryPoint = "LPC2400_ReadData", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
private static extern int LPC2400_ReadData(int siPipeNum, ref byte[] pucRcvBuf, int siReadLen, int siWaitTime);
[DllImport("EasyUSB2400.dll", EntryPoint = "LPC2400_WriteData", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
private static extern int LPC2400_WriteData(int siPipeNum, ref byte[] pucSendBuf, int siSendLen, int siWaitTime);
不过貌似是没成功,可以编译通过,也可以运行,但是Read取不到数据。