another MFC modeless dialog question

  • Thread starter Thread starter Bruno van Dooren
  • Start date Start date
B

Bruno van Dooren

Hi,

i was finally able to get my modeless dialog box to work, but a new problem
did arise.

i have implemented the dialog box in a dll that is called by a command line
application that is native win32
without a message pump.

if i show the dialog modal, it works fine.
if i show if modeless, it is visible, but i cannot do anything with it, and
the cursor changes to the timer cursor.
it seems as if the window accepts no messages.

does anyone know what the problem could be, and how i can solve it?

kind regards,
Bruno.
 
Bruno van Dooren said:
i have implemented the dialog box in a dll that is called by a command line
application that is native win32
without a message pump.

if i show the dialog modal, it works fine.

I should tell you that I don't know much about MFC.

Neverthless, true modal dialog boxes spin their own message pumps with code
like this

while ( GetMessage(&msg, NULL, 0, 0) )
{
TranslateMessge(&msg);
DispatchMessage(&msg);
}
if i show if modeless, it is visible, but i cannot do anything with it, and
the cursor changes to the timer cursor.
it seems as if the window accepts no messages.

No, _it_ accepts the messages. _You_ are not processing them. You, or MFC
code that you cause to run, needs to retrieve messages, check to see if they
are destined for a modeless dialog with IsDialogMessage() and if not
translate and dispatch as above.

Regards,
Will
 
Back
Top