I have created a dialog based application with a menubar. The menubar selection pops up another dialog box. But, this one appears very breifly then disappears behind the maindialog app window. How can I make it stay in front of the parent window? In the properties, I have made sure I have checked visible for the dialog. Below is the code I use:
Call from menubar callback:
void CPrf_plotDlg::OnUserCommandPrfPlot(long wParam, long lParam, short FAR* nRes)
{
CPrf_txtDataDlg myTextDlg;
//char m_str[80];
//sprintf(m_str,"%ld\n", wParam);
// MessageBox(m_str, "User Command:", MB_OK);
// TODO: Add your control notification handler code here
switch (wParam)
{
case 4:
break;
case 5:
case 6:
case 7:
case 8:
case 9: myTextDlg.OpenWindow();
break;
default: fprintf(stderr,"Invalid user command\n"
}
}
The procedure used to create the dialog box:
void CPrf_txtDataDlg::OpenWindow()
{
// open receive dialog
Create (IDD_TEXT_DATA_DLG, NULL);
ShowWindow (SW_SHOW);
}
Thanks for any help.
Scott Urban
Sr. Software Engineer
Lockheed Martin Astronautics
Call from menubar callback:
void CPrf_plotDlg::OnUserCommandPrfPlot(long wParam, long lParam, short FAR* nRes)
{
CPrf_txtDataDlg myTextDlg;
//char m_str[80];
//sprintf(m_str,"%ld\n", wParam);
// MessageBox(m_str, "User Command:", MB_OK);
// TODO: Add your control notification handler code here
switch (wParam)
{
case 4:
break;
case 5:
case 6:
case 7:
case 8:
case 9: myTextDlg.OpenWindow();
break;
default: fprintf(stderr,"Invalid user command\n"
}
}
The procedure used to create the dialog box:
void CPrf_txtDataDlg::OpenWindow()
{
// open receive dialog
Create (IDD_TEXT_DATA_DLG, NULL);
ShowWindow (SW_SHOW);
}
Thanks for any help.
Scott Urban
Sr. Software Engineer
Lockheed Martin Astronautics