我现在要用DLLImport调用C++的dll,方法如下:
[DllImport("aa.dll", EntryPoint = "aa", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
public static extern int DRV_ReadSensorBuffer(int[] values, ref int count);
调用以后总是提示“尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”