
main dialog window is blocked by second dialog window
First, if you create a Modal dialog then it will
retain the focus
until you close it by clicking Cancel, Ok or exit
in some other
way. So you need to create a 'Modeless Dialog" if
you want to
have both at the same time. There are tutorials
on the subject
(I think there is one in MSDN: Creating Modeless
Dialogs???)
BUT...
This sounds like a odd design. Normally, you
would create
the main dialog and then create the second dialog
when the
user clicks on a button to do something that isn't
available
on the main dialog.
Good Luck.
RickL
| Hi!
|
| I created a dialog with the MFC AppWizard. The
| main ".cpp" created the first dialog like this :
|
| /**************************/
| CFirstDlg first;
| m_pMainWnd = &first;
| int nResponse = first.DoModal();
| /**************************/
|
| Now in the "OnInitDialog()" function of
"first"
| I added another dialog ("second") in this
fashion :
|
| /*********************************/
| second.Create(IDD_GRAPH, this);
| second.ShowWindow(SW_SHOW);
| /*********************************/
|
| The declaration "CSecondDlg second;" is included
| in the header file.
| But how come the second dialog covers the
first
| one when the program starts? And even after I
focus
| on the first dialog and move it around, still
the second
| dialog is in the foreground.
| How can I change this, so that the dialog on
which
| I clicked the mouse on steps into the foreground
and
| appears above the other?
|
| Thanks and regards,
|
| Oliver
|
|
|
|