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

引用C++的dll,要怎么改啊
在C++里面的定义是
C/C++ code
extern "C" __declspec(dllimport) bool Usb_Qu_write(byte Qu_index, char Qu_type, char *pData);

我现在要在C# 里面用要怎么改啊。
我弄成
C# code
public static extern bool Usb_Qu_write(byte Q_index, byte Q_type, byte pQ_data); 

然后报错“尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”
大家帮下忙。

------解决方案--------------------
C# code
public static extern bool Usb_Qu_write(Byte Qu_index, SByte Qu_type, [In, Out] SByte[] pData);