On Fri, 10 Jul 2009 12:38:09 +0800
闫程远 <[email protected]> wrote:

> well, that worked. thanks.
> but there's still a problem:
> when i tried to assign a method to the OnProgress property, i got a
> error message:
> 
> UCryptForm.pas(100,37) Error: Wrong number of parameters specified
> for call to "CsOnprogress"
> UCryptForm.pas(59,22) Hint: Found declaration:
> TCryptForm.CsOnprogress(TObject);
> UCryptForm.pas(193, stopping
> 
> 
> the method was declared and implemented as follow:
> 
>   TCryptForm = class(TForm)
>     //... other declarations
>     procedure CsOnprogress(Sender:TObject);
>   private
>     { Private declarations }
>   public
>     { Public declarations }
>   end;
> 
> procedure TCryptForm.CsOnProgress(Sender:TObject);
> begin
>   pb.Position:=Integer(TCompressionStream(Sender).Position div 1024);
>   Application.ProcessMessages;
> end;
> 
> and i assigned the method in this way:
> cs.onProgress:=Self.CsOnprogress;
> 
> why does this get CE?

I mode objfpc you must assign the address to the procedure:

cs.onProgress:[email protected];


>[...lots of old rubbish...] 


Mattias

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to