Re: SDI and a popup dialog
Please post code using code tags and post the code that shows the MESSAGE_MAP entries.
Re: SDI and a popup dialog
Quote:
Originally Posted by
ChayKieu
void MyApplicatioView::OnDisplayDlg()
{
MyDialog d;
INT i=d.DoModal();
}
'i' always gets the value of -1.
From MSDN:
Quote:
The return value is –1 if the function could not create the dialog box, or IDABORT if some other error occurred, in which case the Output window will contain error information from GetLastError.
So what is the output window telling you?
Common causes for this error is when the dialog resource cannot be found. This happens when another resource dll is loaded. Or when one of the controls on the dialog cannot be created. Temporarily set 'no fail create' to yes in the properties of the dialog resource to find out which control is the cause.
Re: SDI and a popup dialog
Thank you, problem resolved, I forgot to add an afx.... in the initinstance before the control on the dialog is used.