请高手给写一个在delphi中怎么定义,调用,我写的一直出错,如下:
Function uncompress(dest:array of byte;destLen:Pint; source:array of byte;sourceLen:integer):integer;stdcall;external 'zlib1.dll'name'uncompress';
调用部分
var
ss,ss1:string;
stext:TStringList;
Inarray,OutArray:array of byte;
Re:Integer;
OutLen:PINT;
begin
stext:=TStringList.Create;
stext.LoadFromFile(ExtractFilePath(Application.ExeName)+'MNLLS.txt');
ss:=DeleteSpace(stext.Text);
ss1:=HexToStr(copy(ss,1,Length(ss)-2));
SetLength(Inarray,Length(ss1));
CopyMemory(@Inarray[0],@ss1[1],Length(ss1));
//ShowMessage(IntToStr(Length(stext.Text)));
if uncompress(OutArray,OutLen,Inarray,Length(ss1))=0 then
ShowMessage('ok');
stext.Free;