Well, you could derive a class and publish the property.<br><br>Antônio<br><br><div class="gmail_quote">2009/7/10 闫程远 <span dir="ltr"><<a href="mailto:yanchengyuan@gmail.com">yanchengyuan@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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" target="_blank">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><font color="#888888">-- <br>
Regards,<br>Yan Chengyuan<br>

</font><br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div><br>