有一个C++程序,原形如下LZ77_API BOOL __stdcall Decompress(int compresscode,BYTE* src, int srclen, BYTE* dest).
此方法在VB中调用成功.本人在C#中调用如下
[DllImport("lz77.dll",CallingConvention=CallingConvention.StdCall,SetLastError=true)]
private static extern bool Decompress(int CompCode,[MarshalAs(UnmanagedType.LPArray)]byte[] ImportList,int length, [MarshalAs(UnmanagedType.LPArray)]ref byte[] GetList);因为此方法的返回值为bool形,还需要返回一个byte数组.bool isDone=Decompress(1,tempList,length,ref returnList);这是我的调用发现返回值isDone显示成功,但是returnList总是不能返回正确的值.不知为什么.请高手指点
此方法在VB中调用成功.本人在C#中调用如下
[DllImport("lz77.dll",CallingConvention=CallingConvention.StdCall,SetLastError=true)]
private static extern bool Decompress(int CompCode,[MarshalAs(UnmanagedType.LPArray)]byte[] ImportList,int length, [MarshalAs(UnmanagedType.LPArray)]ref byte[] GetList);因为此方法的返回值为bool形,还需要返回一个byte数组.bool isDone=Decompress(1,tempList,length,ref returnList);这是我的调用发现返回值isDone显示成功,但是returnList总是不能返回正确的值.不知为什么.请高手指点
解决方案 »
- richTextBox控件的find四参方法,看看吧,不要一分钟,分数轻松拿,熟悉使用的请进!
- 如何在删除gridview的一行数据前,弹出一个提示
- 打开项目出现 此visual studio .net版本不支持受源代码管理的项目
- 当CommandType属性为TableDirect时
- c# 连接excel 出现的问题
- java apache tomat resin iis windwos 的讨论,快来.进入里面的地址的连
- 如何控制 DateTimePicker 控件的月历表中最左边一列是星期几
- 在三层结构下如何实现批量更新数据库?
- 如何让读写文件速度更快?
- FORM关闭问题
- 两地数据同步的问题、、、、、、、、、
- 数据同步问题
http://community.csdn.net/Expert/TopicView3.asp?id=3802426不过你的接口少一个参数:返回的长度