T
taibu
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure ReadDataFile(aApp:TApplication;DllScr:TScreen;aFileNamechar;
DirSizeS);stdcall;
var
PAK: TcymPak;
i,n:integer;
TMPStream:TMemoryStream;
begin
CoInitialize(Nil);
Application:=aApp;
aFileName:='f:/1234.fax';
try
PAK := TcymPak.Create(Nil, aFileName);
n:=Pak.Directory.Count;
DirSize:=Nil;
SetLength(DirSize,n);
for i:=0 to n-1 do
begin
TMPStream:=TMemoryStream.Create;
PAK.ItemToStream(i,TMPStream);
Dirsize:=TMPStream.Size;
TMPStream.Free;
end;
finally
//释放TmpPak
if Assigned(Pak) then
begin
PAK.Free; //如果一执行完这行,则DirSize的值全为空了.这是为什么?
PAK := nil;
end;
end;
end;
DirSizeS);stdcall;
var
PAK: TcymPak;
i,n:integer;
TMPStream:TMemoryStream;
begin
CoInitialize(Nil);
Application:=aApp;
aFileName:='f:/1234.fax';
try
PAK := TcymPak.Create(Nil, aFileName);
n:=Pak.Directory.Count;
DirSize:=Nil;
SetLength(DirSize,n);
for i:=0 to n-1 do
begin
TMPStream:=TMemoryStream.Create;
PAK.ItemToStream(i,TMPStream);
Dirsize:=TMPStream.Size;
TMPStream.Free;
end;
finally
//释放TmpPak
if Assigned(Pak) then
begin
PAK.Free; //如果一执行完这行,则DirSize的值全为空了.这是为什么?
PAK := nil;
end;
end;
end;