Help With Dialog Based App
-
I have made a dialog based MFC app but found a big problem. If someone is entering values into the edit boxes and then hits enter it closes the program. If you hit enter at all while the program is running and in focus it will end the program. How can I fix this? Thanks
-
I have made a dialog based MFC app but found a big problem. If someone is entering values into the edit boxes and then hits enter it closes the program. If you hit enter at all while the program is running and in focus it will end the program. How can I fix this? Thanks
You can override OnOK() (and possibly OnCancel()) and in your overridden method, do nothing. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You can override OnOK() (and possibly OnCancel()) and in your overridden method, do nothing. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hi I cannot find those functions anywhere. I have this
CDLIADlg dlg;
m\_pMainWnd = &dlg; //Brings up main dialog box INT\_PTR nResponse = dlg.DoModal(); //Ends program return FALSE;
Brings up the main dialog, but I can't find the OnOk or OnCancel in the main dialog
-
Hi I cannot find those functions anywhere. I have this
CDLIADlg dlg;
m\_pMainWnd = &dlg; //Brings up main dialog box INT\_PTR nResponse = dlg.DoModal(); //Ends program return FALSE;
Brings up the main dialog, but I can't find the OnOk or OnCancel in the main dialog
They are virtual functions declared in the CDialog class. You can add them through the class properties window or add them by hand
virtual void OnOK();
virtual void OnCancel();...
void CDLIADlg::OnOK()
{
}void CDLIADlg::OnCancel()
{
}Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
They are virtual functions declared in the CDialog class. You can add them through the class properties window or add them by hand
virtual void OnOK();
virtual void OnCancel();...
void CDLIADlg::OnOK()
{
}void CDLIADlg::OnCancel()
{
}Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I have made a dialog based MFC app but found a big problem. If someone is entering values into the edit boxes and then hits enter it closes the program. If you hit enter at all while the program is running and in focus it will end the program. How can I fix this? Thanks
simoncoul wrote:
How can I fix this?
By reading here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne