[Lazarus] Windows.PostMessage vs Application.QueueAsyncCall
Marcos Douglas
md at delfire.net
Mon Mar 17 15:36:23 CET 2014
On Mon, Mar 17, 2014 at 11:11 AM, Michael Schnell <mschnell at lumino.de> wrote:
> On 03/17/2014 01:31 PM, Marcos Douglas wrote:
>>
>> Yes, but the QueueAsyncCall needs to know what procedure to call for a
>> especific object (instance)
>
>
> I don't understand.
>
> The definition of the function (I use) is
>
> procedure TApplication.QueueAsyncCall(const AMethod: TDataEvent; Data:
> PtrInt);
>
> with
>
> TDataEvent = procedure (Data: PtrInt) of object;
>
>
> I don't see an "instance" here.
CASE 1:
You have MainForm (Main) and ProcessForm (Proc).
Proc do not know Main but Main needs to be updated about what happen
in Proc so, Proc can use QueueAsyncCall that need a TDataEvent
procedure as argument. If Proc not know Main, how he know the
procedure (TDataEvent) to pass on argument?
Sugestion: I can Create Proc passing the procedure (TDataEvent) to
call inside Proc.
CASE 2:
You have MainForm (Main), InfoForm (that have 2 Frames F1 and F2 that
not know InfoForm) and ProcessForm (Proc).
Proc do not know Main, InfoForm or frames but they needs to be updated
about what happen in Proc so, Proc can use QueueAsyncCall that need a
TDataEvent procedure as argument. If Proc not know about these
"Handlers", how he know the procedure (TDataEvent) to pass on
argument?
--
I think that I need is too much for a simple call to QueueAsyncCall.
I'm doing tests with FP Observer implementation too.
Best regards,
Marcos Douglas
More information about the Lazarus
mailing list