Message Handling in LCL ?? (was Re: [lazarus] More Native Win32 stuff (Pascal, can you help here?)

Michael A. Hess mhess at miraclec.com
Tue Aug 10 05:47:15 EDT 1999


Pascal Dutilleul wrote:
> 
> It has something to do with IntSendMessage...
> 
> If I declare a
>   procedure MyHandler(...); message LM_MYMESSAGE;
> 
> How does LCL call MyHandler when it received the message ?

Well in a sense the LCL doesn't. The RTL does. When the compiler sees
the above declaration it creates a Table for the class object being
created. In this table it places a pointer to the defined procedure
MyHandler with the key LM_MYMESSAGE.

In the SetCallback routine we pass Self to the gtkcallback routine so
that it will be able to indicated exactly which LCL class object should
be receiving the callback message. In the callback routine we call the
Dispatch routine found with each object passing it the message. It goes
through the table looking for the LM_MYMESSAGE and when found calls the
associated MyHandler. 

So each object does have it's own message handling built in.
 
I haven't actually looked at the Windows methods of doing messaging so I
can't say off the top of my head exactly the way to do it but I can't
imageing that it would work very much differently then the way we are
already doing it with GTK.

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list