Hi,
I have a dialog based application. I want to pop up a little dialog box asking for a serial number before starting the main application. I used the following code in the constructor of the main dialog window:
Code:
CDialog serialDlg(IDD_SERIAL);
// Create and show the dialog box
INT_PTR nRet = -1;
nRet = serialDlg.DoModal();
CString newValue;
// Handle the return value from DoModal
switch ( nRet )
{
case -1:
AfxMessageBox("Dialog box could not be created!");
break;
case IDABORT:
// Do something
break;
case IDOK:
m_serial.GetWindowText(newValue);
break;
case IDCANCEL:
// Do something
break;
default:
// Do something
break;
};
DDX_Control(pDX, IDC_EDITSERIAL, m_serial);
m_serial is a CEdit variable in my main dialog class.
Alas it is giving me an exception error. Anybody would know how to go about doing that. Thanks
Amish