I'm making a MFC dialog box application and using the code generated by default when the user clicks ok or cancel the application will close. I want to change, the application won't close, and I can implement an exit button or something later. I changed the function to return TRUE; but it still closes… how do you stop this?
Code:
BOOL CBasic_Order_WindowApp::InitInstance()
{
CWinApp::InitInstance();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("SG Cap. - Options – Test Buy/Cancel Application"));
CBasic_Order_WindowDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}