2006/8/7, Michael Van Canneyt <[EMAIL PROTECTED]>:


On Mon, 7 Aug 2006, Alexandre Leclerc wrote:

> Using pascal script component:
>
> type
>  TMyProc = procedure(param: TObject);
> var
>  MyProc: TMyProc;
> ..
> MyProc := TMyProc(PSExec.GetProcAsMethodN('ScriptedMyProc'));
>
> Ok, the GetProcAsMethodN function returns a TMethod type. When I try
> to compile that it gives me a "unit1.pas(374,27) Error: Illegal type
> conversion: "<record type>" to "<procedure variable type of
> procedure(TObject);Register>".
>
> But if I add 'of object' to have a procedure of object, the compiler
> is not complaining. I do not whish to use the 'of object' stuff.

You do not have a choice; If PSExec.GetProcAsMethodN returns a method,
then you must use the 'Of object' construct.

Michael.

Thank you Michael, so it was something I did not understood. ;)

Best regards.

--
Alexandre Leclerc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to