wince +sl 群

c# 调用c DLL 所传参数不正确

C

void chaos(char * pBuf, long len, int type);

 

c# 

[DllImport("DecodeFileDll.dll", CallingConverntion = CallingConvertion.Cdecl)]

public static extern void chaos(byte[] pBuf, long len, int type);

 

c# 调用c的时候

choas(buf, 100,2);

但在C的时候,type总是为0

发现是C# long 为8个字节 c long 为4个字节。

统一一种类型:全部是long或全部是int

void chaos(char * pBuf, int len, int type);

 

posted @ 2015-08-01 17:39  pengxinglove  阅读(378)  评论(0编辑  收藏  举报
wince +sl 群