W
wiseinfo
Unregistered / Unconfirmed
GUEST, unregistred user!
为了方便,用了FASTMM4的最新版本,
DLL中:
function ZipFiles(vSourceFiles: string
vZipFilef: string): Boolean;
begin
ShowMessage(vSourceFiles)
//vSourceFiles的值正确传入
ShowMessage(vZipFilef)
//但vZipFilef 没有正确传入,是空的,????????
Result := True;
end;
EXE中调用:
procedure TForm6.Button4Click(Sender: TObject);
type
TZipFiles = function(const vSourceFiles: string
vZipName: string): Boolean
stdcall;
var
Th: Thandle;
ZipFiles: TZipFiles;
ZipUnLoad: TZipUnLoad;
vFileName: string;
vZipName: string;
begin
Th := LoadLibrary('HxLibZipEx.dll')
{装载DLL}
if Th = 0 then exit;
try
ZipFiles := GetProcAddress(Th, PChar('ZipFiles'));
if @ZipFiles <> nil then
begin
vFileName := 'R:/INFO7/Sysinfo.mdb,r:/info7/wisesta.exe';
vZipName := 'C:/FFF.zip';
if ZipFiles(vFileName, vZipName) then
ShowMessage('OK');
end
else
ShowMessage('函数没有找到');
finally
FreeLibrary(Th)
{释放DLL}
end
end;
DLL中:
function ZipFiles(vSourceFiles: string
vZipFilef: string): Boolean;
begin
ShowMessage(vSourceFiles)
//vSourceFiles的值正确传入
ShowMessage(vZipFilef)
//但vZipFilef 没有正确传入,是空的,????????
Result := True;
end;
EXE中调用:
procedure TForm6.Button4Click(Sender: TObject);
type
TZipFiles = function(const vSourceFiles: string
vZipName: string): Boolean
stdcall;
var
Th: Thandle;
ZipFiles: TZipFiles;
ZipUnLoad: TZipUnLoad;
vFileName: string;
vZipName: string;
begin
Th := LoadLibrary('HxLibZipEx.dll')
{装载DLL}
if Th = 0 then exit;
try
ZipFiles := GetProcAddress(Th, PChar('ZipFiles'));
if @ZipFiles <> nil then
begin
vFileName := 'R:/INFO7/Sysinfo.mdb,r:/info7/wisesta.exe';
vZipName := 'C:/FFF.zip';
if ZipFiles(vFileName, vZipName) then
ShowMessage('OK');
end
else
ShowMessage('函数没有找到');
finally
FreeLibrary(Th)
{释放DLL}
end
end;