2016-05-02 15:38 GMT+02:00 Martin Schreiber <[email protected]>:
> MSEgui does not use messages often, there are dedicated virtual functions and
> procedures instead. What do you want to achieve?

In LCL app which I'm porting to MSEgui, I have modal form which start
thread. When thread finish, form should automatically close. In LCL
calling Self.Close in thread OnTerminated raised weird exception so
had do this in next queue by async:

PostMessage(Self.Handle, LM_CLOSEQUERY, 0, 0);

Tested now with MSEgui and I can close modal form in thread
OnTerminate without any problems so that is not issue anymore.

> In order to simulate QueueAsyncCall post a TExecuteEvent descendant to the
> main event queue by Application.PostEvent. I'll probably add a
> QueueAsyncCall() procedure for convenience.
> In order to access GUI elements from a thread I normally use
> "
>  try
>   application.lock();
>   //access gui elements
>   ...
>  finally
>   application.unlock();
>  end;

I used QueueAsyncCall for update GUI from external lib callbacks. I'm
using audio library (bass.so), it can play online radio and notify
about meta data changed. I noticed when that callback is called,
direct GUI change raised exceptions, probably because that lib notify
from own internal thread, so updating GUI from QueueAsyncCall solved
that problem. I guess that your example with application.lock(); do
the trick

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to