Hi all!
i wanted to compress a file using TCompressionStream, with a progressbar to show the progress.
i wrote the code but they got Compilation Error:
var
fs,ms:TMemoryStream;
cs:TCompressionStream;
size:int64;
begin
fs:=TMemoryStream.Create;
fs.LoadFromFile(SourceFile.Text);
size:=fs.Size;
ms:=TMemoryStream.Create;
ms.Write(size,sizeof(size));
cs:=TCompressionStream.create(clMax,ms);
pb.Max:=Integer(size div 1024);
cs.onProgress:=CsOnProgress;
fs.SaveToStream(cs);
cs.Free;
ms.SaveToFile(DestFile.Text);
ms.Free;
fs.Free;
end;
the Error Messages are:
UCryptForm.pas(105,6) Error: identifier idents no member "onProgress"
UCryptForm.pas(105,30) Error: Wrong number of parameters specified for call
to "CsOnprogress"
UCryptForm.pas(63,22) Hint: Found declaration:
TCryptForm.CsOnprogress(TObject);
UCryptForm.pas(198) Fatal: There were 2 errors compiling module, stoppingi searched on the web, and found this page:
http://community.freepascal.org:10000/docs-html/fcl/zstream/tcompressionstream.onprogress.html in this page, the OnProgress property was declared as "public", and on my machine, the property is declared as "protected".
Can anybody tell me why?
Thanks in advance.
