L
LittleSong
Unregistered / Unconfirmed
GUEST, unregistred user!
Dll 代码
============
library Compress;
uses
ShareMem,SysUtils,Classes,Windows, Messages,AbBase, AbBrowse, AbZBrows,
AbZipper, AbUnZper, AbZipKit,AbArcTyp;
Function ZipFile(DFileName,SFileName:String):Integer;StdCall;
Var
AbZipper: TAbZipper;
Begin
Try
AbZipper:=TAbZipper.Create(Nil);
With AbZipper Do Begin
FileName:=DFileName;
AddFiles(SFileName,0);
End;
Result:=0;
Except
Result:= -1;
End;
End;
Procedure UnZipFile(UnComPressPath,Compressfile:String);StdCall;
Var
AbUnZipper: TAbUnZipper;
Begin
with AbUnzipper do begin
FileName := Compressfile;
BaseDirectory := ExtractFilePath(UnComPressPath);
ExtractFiles( '*.*' );
end;
End;
Exports
ZipFile,
UnZipFile;
Begin
end.
接口代码
===================
unit comm;
interface
uses
ShareMem,Windows, Messages, SysUtils, Classes;
Function Zipfile(DFileName,SFileName:String):integer;Stdcall;
Procedure UnZipfile(UnComPressPath,Compressfile:String);Stdcall;
implementation
Function Zipfile; External 'Compress.dll' Index 1;
Procedure UnZipfile; External 'Compress.dll' Index 2;
end.
问题:
1。调用时出错。
2。接口中如果写成 Function Zipfile;External 'Compress.dll' Name 'Zipfile';则出现无法定位错
============
library Compress;
uses
ShareMem,SysUtils,Classes,Windows, Messages,AbBase, AbBrowse, AbZBrows,
AbZipper, AbUnZper, AbZipKit,AbArcTyp;
Function ZipFile(DFileName,SFileName:String):Integer;StdCall;
Var
AbZipper: TAbZipper;
Begin
Try
AbZipper:=TAbZipper.Create(Nil);
With AbZipper Do Begin
FileName:=DFileName;
AddFiles(SFileName,0);
End;
Result:=0;
Except
Result:= -1;
End;
End;
Procedure UnZipFile(UnComPressPath,Compressfile:String);StdCall;
Var
AbUnZipper: TAbUnZipper;
Begin
with AbUnzipper do begin
FileName := Compressfile;
BaseDirectory := ExtractFilePath(UnComPressPath);
ExtractFiles( '*.*' );
end;
End;
Exports
ZipFile,
UnZipFile;
Begin
end.
接口代码
===================
unit comm;
interface
uses
ShareMem,Windows, Messages, SysUtils, Classes;
Function Zipfile(DFileName,SFileName:String):integer;Stdcall;
Procedure UnZipfile(UnComPressPath,Compressfile:String);Stdcall;
implementation
Function Zipfile; External 'Compress.dll' Index 1;
Procedure UnZipfile; External 'Compress.dll' Index 2;
end.
问题:
1。调用时出错。
2。接口中如果写成 Function Zipfile;External 'Compress.dll' Name 'Zipfile';则出现无法定位错