Re: Thread Deadlock
From: Scott McPhillips [MVP] (org-dot-mvps-at-scottmcp)
Date: 09/14/04
- Next message: Scott McPhillips [MVP]: "Re: How to insert a dialog in vc using the control of vb?"
- Previous message: Janusz Grabis: "Re: Hiding CEdit derived window !"
- In reply to: rob: "Re: Thread Deadlock"
- Next in thread: OL: "Re: Thread Deadlock"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Sep 2004 08:38:35 -0500
rob wrote:
> Heinz & all,
>
> Thanks for your input. I have a question, though. How can an app update
> itself when an event handler of this app creates a modal dialog? The app
> does not get out of the event handler until the dialog is closed. So how
> does the message loop in the modal dialog help the app to be updated? In my
> thread I can't directly call a function in the main app (I am not sending
> messages but do a direct call). So how can a function in the main app be
> executed when the app is stuck in the event handler that popped up the modal
> dialog?
>
> Regards,
> Robert
The modal dialog
The modal dialog does not interfere with custom message processing by
the application's other windows. Direct calls that update windows
created in the main thread are not supported by MFC and can lead to
several problems. Your thread should PostMessage to request the main
thread to update things, and PostMessage to signal when it has finished.
See http://www.mvps.org/vcfaq/mfc/index.htm
-- Scott McPhillips [VC++ MVP]
- Next message: Scott McPhillips [MVP]: "Re: How to insert a dialog in vc using the control of vb?"
- Previous message: Janusz Grabis: "Re: Hiding CEdit derived window !"
- In reply to: rob: "Re: Thread Deadlock"
- Next in thread: OL: "Re: Thread Deadlock"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|