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