Click here to Skip to main content
15,921,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow does a modal dialog work (message pump)? Pin
29-May-02 4:29
suss29-May-02 4:29 
AnswerRe: How does a modal dialog work (message pump)? Pin
Joaquín M López Muñoz29-May-02 4:58
Joaquín M López Muñoz29-May-02 4:58 
GeneralRe: How does a modal dialog work (message pump)? Pin
Maximilien29-May-02 5:30
Maximilien29-May-02 5:30 
GeneralRe: How does a modal dialog work (message pump)? Pin
Joaquín M López Muñoz29-May-02 5:49
Joaquín M López Muñoz29-May-02 5:49 
GeneralRe: How does a modal dialog work (message pump)? Pin
29-May-02 5:28
suss29-May-02 5:28 
GeneralRe: How does a modal dialog work (message pump)? Pin
Joaquín M López Muñoz29-May-02 8:29
Joaquín M López Muñoz29-May-02 8:29 
GeneralRe: How does a modal dialog work (message pump)? Pin
29-May-02 13:13
suss29-May-02 13:13 
GeneralRe: How does a modal dialog work (message pump)? Pin
29-May-02 18:20
suss29-May-02 18:20 
Moak wrote:
I added verbose debug output. It looks like the mainframe "takes over" the message pump activity, and never give control back to my OpenGL mainloop. So it does not get the chance to continue it's work to quit.

After a night of debugging, spending time in Petzold and MFC wincore.cpp it looks like only CWnd derived classes can provide an own messagepump within MFC.

Well, I'm not sure and honestly I'm not much less confused as I was before. Smile | :) I found no way to mix MFC messagepump with a Win32 messagepump. It looks possible in CWnd::RunModalLoop() to have more then one message pump (only one active at one time), but this seems not to be possible when mixing MFC (CWnd) with Win32 (homebrew).

Are there workarounds?
I can start my OpenGL window in a own thread, but I don't want to leave the thread context. How about calling my MainRender() method as often as possible? Any ideas how to achieve this, using OnIdle or set a windows hook for GetMessage(), etc?

Thx, Moak
GeneralRe: How does a modal dialog work? Code snippets Pin
29-May-02 13:36
suss29-May-02 13:36 
GeneralRe: How does a modal dialog work? Code snippets Pin
Joaquín M López Muñoz29-May-02 23:12
Joaquín M López Muñoz29-May-02 23:12 
GeneralRe: How does a modal dialog work? Workaround Pin
30-May-02 0:50
suss30-May-02 0:50 
GeneralRe: How does a modal dialog work? Workaround Pin
Joaquín M López Muñoz30-May-02 2:36
Joaquín M López Muñoz30-May-02 2:36 
GeneralRe: How does a modal dialog work? Workaround Pin
30-May-02 6:59
suss30-May-02 6:59 
GeneralRe: How does a modal dialog work? Workaround Pin
Joaquín M López Muñoz1-Jun-02 5:28
Joaquín M López Muñoz1-Jun-02 5:28 
AnswerRe: How does a modal dialog work (message pump)? Pin
Paul M Watt29-May-02 7:24
mentorPaul M Watt29-May-02 7:24 
GeneralFile Type Association Pin
moobob29-May-02 4:34
moobob29-May-02 4:34 
GeneralRe: File Type Association Pin
Mauricio Ritter29-May-02 6:27
Mauricio Ritter29-May-02 6:27 
GeneralRe: File Type Association Pin
moobob29-May-02 7:06
moobob29-May-02 7:06 
GeneralCombo box without dropdown button Pin
ed987129-May-02 4:03
ed987129-May-02 4:03 
GeneralRe: Combo box without dropdown button Pin
dlhson29-May-02 6:09
dlhson29-May-02 6:09 
GeneralRe: Combo box without dropdown button Pin
ed987129-May-02 7:15
ed987129-May-02 7:15 
GeneralRe: Combo box without dropdown button Pin
aldeba29-May-02 23:48
aldeba29-May-02 23:48 
GeneralConvert a HRESULT to a string Pin
Anders Molin29-May-02 3:32
professionalAnders Molin29-May-02 3:32 
GeneralRe: Convert a HRESULT to a string Pin
Philippe Mori29-May-02 3:49
Philippe Mori29-May-02 3:49 
GeneralRe: Convert a HRESULT to a string Pin
CodeGuy29-May-02 3:44
CodeGuy29-May-02 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.