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);
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);
相关文章推荐
- c#事件与委托
- C#之Action和Func的用法
- 银联SOFTPOS客户端接口 C#例子
- c# 判断输入的号码是否是合法的手机号码
- 【加密与解密】C#如何读取pem的KEY文件
- C#导出Excel
- C#(WinForm) ComboBox和ListBox添加项
- c#中子窗体中datagridview选中一条数据,把选中数据传回父窗体,使用tag
- C#属性、结构体、索引器、泛型
- C#自定义类型转换
- C#接口相关知识
- c#运算符重载
- c# winform DataGridView选择一整行的相关属性
- c#高级编程第七版 学习笔记 第二章 核心c#
- C# socket 局域网聊天程序的一点心得
- C#中的数组
- C# 自定义特性的使用
- C# 根据KeyEventArgs与组合键字符串相互转换
- C# 根据KeyEventArgs与组合键字符串相互转换
- C#结构体的特点浅析