当前位置: 代码迷 >> VFP >> 有没有用过delphi的解决思路
  详细解决方案

有没有用过delphi的解决思路

热度:8706   发布时间:2013-02-26 00:00:00.0
有没有用过delphi的
http://access911.net/csdn/FileDescription.asp?mdb=2011-10-26&id=42&mode=3

客户的程序

从中提取了两个函数编译成dll提供给vfp使用

调用过程中出现错误

上面地址为dll下载链接

Delphi(Pascal) code
function CompressFile(const DestFile,SrcFile:pchar;const Level: TCompressionLevel):Boolean;stdcall; //压缩function DeCompressFile(const DestFile,SrcFile:pchar):boolean;stdcall;//解压缩


DestFile: 生成文件
SrcFile: 源文件
Level: 压缩级别
0 不压缩
1 快速
2 默认
3 最大

先测一下压缩函数

提示: 声明 dll 调用出现异常

在vfp 中声明如下
Declare integer CompressFile In ConvertFormat.dll string @,string @,integer

声明时没有错误提示

------解决方案--------------------------------------------------------
你是不是没有加上路径:

我用如下代码可以,没有问题

Declare integer CompressFile In C:\ConvertFormat.dll string @,string @,integer
Declare integer DeCompressFile In C:\ConvertFormat.dll string,string
?CompressFile('c:\a.rar','c:\test.txt',2)
?DeCompressFile('c:\a.txt','c:\a.rar')
  相关解决方案