C#调用C++Dll异常
C++的原函数是
unsigned char __stdcall RC500USB_read(unsigned char addr,unsigned char *data);
VB调用DLL文件不会出现问题
Declare Function RC500USB_read Lib "RC500USB.dll" (ByVal addr As Byte, ByRef data As Byte) As Byte
用C#我是这么调用的
[DllImport("RC500USB.dll")]
public static extern byte RC500USB_read(byte addr,ref byte[] data);
运行的时候报错 “引发类型为“System.ExecutionEngineException”的异常。”怎么回事的。求高手帮忙