Click to See Complete Forum and Search --> : A simple question about Modeless Dialogs...


Mike
April 2nd, 1999, 09:10 AM
When my program starts, it is supposed to have a modeless dialog box displayed ontop of the main application window. However, when the program starts this is not what happens.

First, the dialog box appears as I would expect, but then the Dialog box is covered up by the main application's window.

My dialog box is a member of the CMainFrame class, and I attempt to display the dialog at the very end of the CMainFrame::OnCreate function. Doing this works with MDI applications, but not with SDI applications for some reason.

Any help would be appriciated.
Mike.

Lynx
April 2nd, 1999, 09:30 AM
A simple solution:
1. create a public function in CMainFrame class, e.g., ShowMyDialog() and put those codes to display the modeless dislog.
2. call this function in the App's InitInstance(), but call it after initializing MainFrame:
pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
pMainFrame->UpdateWindow();
pMainFrame->ShowMyDialog();

Hope this will help. Good luck.

Lynx