Thx!<br><br><div class="gmail_quote">2009/7/10 Mattias Gaertner <span dir="ltr"><<a href="mailto:nc-gaertnma@netcologne.de">nc-gaertnma@netcologne.de</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;">
<div><div></div><div class="h5">On Fri, 10 Jul 2009 12:38:09 +0800<br>
闫程远 <<a href="mailto:yanchengyuan@gmail.com">yanchengyuan@gmail.com</a>> wrote:<br>
<br>
> well, that worked. thanks.<br>
> but there's still a problem:<br>
> when i tried to assign a method to the OnProgress property, i got a<br>
> error message:<br>
><br>
> UCryptForm.pas(100,37) Error: Wrong number of parameters specified<br>
> for call to "CsOnprogress"<br>
> UCryptForm.pas(59,22) Hint: Found declaration:<br>
> TCryptForm.CsOnprogress(TObject);<br>
> UCryptForm.pas(193, stopping<br>
><br>
><br>
> the method was declared and implemented as follow:<br>
><br>
> TCryptForm = class(TForm)<br>
> //... other declarations<br>
> procedure CsOnprogress(Sender:TObject);<br>
> private<br>
> { Private declarations }<br>
> public<br>
> { Public declarations }<br>
> end;<br>
><br>
> procedure TCryptForm.CsOnProgress(Sender:TObject);<br>
> begin<br>
> pb.Position:=Integer(TCompressionStream(Sender).Position div 1024);<br>
> Application.ProcessMessages;<br>
> end;<br>
><br>
> and i assigned the method in this way:<br>
> cs.onProgress:=Self.CsOnprogress;<br>
><br>
> why does this get CE?<br>
<br>
</div></div>I mode objfpc you must assign the address to the procedure:<br>
<br>
cs.onProgress:=@Self.CsOnprogress;<br>
<br>
<br>
>[...lots of old rubbish...]<br>
<font color="#888888"><br>
<br>
Mattias<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Yan Chengyuan<br>