[fpc-devel] procedure ... message
Vincent Snijders
vsnijders at quicknet.nl
Tue Feb 13 13:29:56 CET 2007
Michael Schnell schreef:
>
>> I see you are still a bit lost. Maybe the documentation can help:
>> http://www.freepascal.org/docs-html/ref/refsu24.html
> I in fact am lost (as I still don't dare to try to look into the
> compiler's source code).
>
> Unfortunately the docs text does not say what code the compiler
> generates to make the library assign the message to the function it
> generates from the users source code.
That is because the compiler doesn't generate that code.
Somewhere user code must call
MyObject.Dispatch(MyMessage);
See implementation of dispatch. It gets the message number and looks for the
corresponding method in a table. The compiler generates this table at compile time.
This may not be the completely accurate description, but this is how I model things
in my mind and in my experiments reality hasn't falsified this model.
Vincent
More information about the fpc-devel
mailing list