Re: How to wait on events in main event loop (eg. using MsgWaitForMultipleObjectsEx()) ?

"Igor Tandetnik" <[email protected]> Wed, 8 Aug 2012 23:10:10 -0400
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Richard <dj_deipotent-/[email protected]> wrote:
> I want to be able to wait on events in the main event loop as well as
> normal messages. I understand I can use MsgWaitForMultipleObjectsEx() as
> shown in the second code fragment here:
> 
> http://weblogs.asp.net/kennykerr/archive/2007/12/12/parallel-programming-with-c-part-2-asynchronous-procedure-calls-and-window-messages.aspx
> 
> I need a way to call different methods if different events get set.

The return value of MsgWaitForMultipleObjects tells you which handle, or the window message, satisfied the wait.

> The reason for this is that I want to be able to set an event in a
> thread and have my main UI thread process it.

Any reason the thread can't just post a user-defined message to some window in the main UI?
-- 
Igor Tandetnik



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/