//Copy data buffer data to another buffer [DllImport("Test.dll", CharSet=CharSet.Ansi)] private static extern bool CopyToBuffer(int dbHandle, IntPtr buff, int buffSize); 类似于这样
[DllImport("Test.dll")] public static extern void xx_send(byte[] buf,int size);
[DllImport("Test.dll", CharSet=CharSet.Ansi)]
private static extern bool CopyToBuffer(int dbHandle,
IntPtr buff,
int buffSize);
类似于这样
public static extern void xx_send(byte[] buf,int size);
[DllImport("Test.dll")]
public static extern void xx_send(byte[] buf,int size);
虽然可以收到 数据,size也正确,但buf只能访问一个字节,和size还是对不上,[DllImport("Test.dll", CharSet=CharSet.Ansi)]
private static extern bool CopyToBuffer(int dbHandle,
IntPtr buff,
int buffSize);
这个函数自己实现么?