|
-
July 9th, 2011, 05:48 AM
#1
SDI and a popup dialog
I have a dialog class defined as
class MyDialog ublic CDialogEx
{};
and I'd like to call up the dialog after a right mouse click on the view of a SDI application
The menu is shown after the right mouse click but there is no dialog displayed after I select its item "call dialog".
void MyApplicatioView::OnDisplayDlg()
{
MyDialog d;
INT i=d.DoModal();
}
'i' always gets the value of -1.
Would you helo me please ?
Thank you
-
July 9th, 2011, 11:55 AM
#2
Re: SDI and a popup dialog
Please post code using code tags and post the code that shows the MESSAGE_MAP entries.
-
July 9th, 2011, 06:07 PM
#3
Re: SDI and a popup dialog
 Originally Posted by ChayKieu
void MyApplicatioView::OnDisplayDlg()
{
MyDialog d;
INT i=d.DoModal();
}
'i' always gets the value of -1.
From MSDN:
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.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
July 10th, 2011, 02:40 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|