[Lazarus] Windows.PostMessage vs Application.QueueAsyncCall

Marcos Douglas md at delfire.net
Mon Mar 17 20:28:06 CET 2014


On Mon, Mar 17, 2014 at 3:12 PM, Joao Morais <l at joaomorais.com.br> wrote:
> Em 15/03/14 22:47, Marcos Douglas escreveu:
>
>> So, what the best way to substitute PostMessage?
>> Maybe using QueueAsyncCall  +  IFPObserved/IFPObserver?
>
>
> Have you tried decoupling your classes with interfaces?

I thought, yes, but I want to keep simple as possible.

> If I understood your
> scenario correctly: Main implements an interface known by Proc, which sends
> itself to the Proc constructor.

That's an idea... but isn't like that today. Proc (following example)
do not know Main or any interface that Main knows.
Proc could be used in many others classes and not knows nothing about
these classes.

Using PostMessage Proc just notify "handlers" about a message with the
possibility to send "value objects" too.

Regards,
Marcos Douglas




More information about the Lazarus mailing list