我利用CLR项目建置DLL,类别如下
Test(BYTE *map,int size);然后我利用C#去CALL DLL
我定義 byte[] Output = new byte[50];
带入 Test(Output,50);
出现了 无法从'byte[]' 转换为'byte*
这个要如何去转换??
Test(BYTE *map,int size);然后我利用C#去CALL DLL
我定義 byte[] Output = new byte[50];
带入 Test(Output,50);
出现了 无法从'byte[]' 转换为'byte*
这个要如何去转换??
private static extern int Test(Byte[] map, int size);
利用参考加入的方法,并不是用DllImport的方式
C#代出来的函式 就是public int Test(byte* map,int size);
所以才需从'byte[]' 转换为'byte*
a.Length);
Marshal.Copy(a, 0, temp, a.Length);AddData(temp);Marshal.FreeCoTaskMem(temp);