您的位置:首页 > 编程语言 > C#

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

2015-08-01 17:39 232 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: