[fpc-pascal]Re: Method in WndClassEX

Luis Del Aguila aguila3000 at terra.com.pe
Sat Oct 13 14:51:12 CEST 2001

Message: 4
Date: Fri, 12 Oct 2001 15:53:25 +0200
Subject: Re: [fpc-pascal]Method in WndClassEX
From: Jonas Maebe <jonas at zeus.rug.ac.be>
To: fpc-pascal at deadlock.et.tudelft.nl
Reply-To: fpc-pascal at lists.freepascal.org

On donderdag, oktober 11, 2001, at 07:02 , Luis Del Aguila wrote:

>  may I allocate a metthod in the field lpfnWndProc of the WndClassEX
> Registers?
> Like this :
>   ClaseVentana : WndClassEX;
>    ...
>    ClaseVentana.lpfnWndProc := WndProc(M├ętodo);

No, you cannot assign methods to normal procedure variables, only normal
procedures. The reason is that methods always expect an extra parameter
containing the self pointer of the object/class instance they are
working on. If you do the above, then when windows calls you "wndproc"
(which isn't really a wndproc, since you have to add an explicit type
cast for the compiler to accept the statement), it won't pass any self
pointer and as such the method will not work correctly.


Existe alguna manera de pasar un metodo al registro lpfnWndProc usando
ensamblador o algo mejor?

Do you know when allocate a metthod in the field lpfnWndProc of the
WndClassEX using Assembler or something best?

More information about the fpc-pascal mailing list