[fpc-devel] procedure ... message

Michael Schnell mschnell at lumino.de
Tue Feb 13 12:33:26 CET 2007


peter green wrote:
>> What does the compiler do when translating "procedure ... message" ?
>>
>> I need to know this as I want to create a non-GUI workalike of the 
>> TApplication class that can do things like "TTimer" 
>> "TThread.Synchronize", Message events, etc, using Windows messages in 
>> Windows (for testing purpose) and system V message queues in Linux.
>>     
> afaict it does the same as delphi does, puts them in some form of table which is used by the dispatch method in tobject (which on delphi at least is called from wndproc which is called from mainwindowproc which is registered as the window procedure for the window and hence called by windows when the mainloop calls the windows api function dispatchmessage).
>
>   
Thanks a lot for your answer.

That is the result of what is happening. Most of it is done by the 
library (the compiler can't do this by itself), and I am trying to use 
some home-brew library functions here.

What I wanted to know is how the compiler does this (or how I can find 
out what exactly it does).

I _assume_ that when it sees "procedure ... message" the compiler in the 
"initialization" section generates a call to a library function that is 
supposed to register the message with the procedure. I need to know the 
name of this function so that I can do it in my new library.

I suppose in the end WidgetSet.AddEventHandler is called, but as the 
compiler does not know about a WidgetSet object that is created by the 
initialization of the RTL done by the library, I suppose some mechanism 
in the library is catching the stuff the compiler magic creates for 
"procedure ... message".

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20070213/88441aa6/attachment.html>


More information about the fpc-devel mailing list