Using CPropertySheet on a dialog
Posted on 2002-05-07
I'm trying to use a CPropertySheet control on a dialog. I had it working before but now there's a problem. I used this method to create the control:
1.) I made a static control on the dialog box.
2.) I positioned this control where I wanted the CPropertySheet control.
3.) I associated a variable with this control.
4.) I created the CPropertSheet control and positioned it over the static control.
CPropertySheet m_sheet; //Creating the CPropertySheet
CStatic m_ctrlStatic; //Declaring the Variable
DDX_Control(pDX, IDC_SHEET_STATIC, m_ctrlStatic); //Associating the static control with the variable
m_sheet.Create(this,WS_VISIBLE|WS_CHILD); //Create the CPropertySheet control
CRect rect; //Make a positioning object
m_ctrlStatic.GetWindowRect(&rect); //Get position of the static control
ScreenToClient(&rect); //Ready the position for the MoveWindow function
m_sheet.MoveWindow(&rect); //Position the CPropertySheet control over the static control
It used to work, but i must have screwed it up somehow because I now get this error:
Debug Assertion Failed!
I pressed the Retry button and then the Debug button. It pointed me to this line:
in the MoveWindow Function. This prompted me to believe that the error was occuring because of this line:
I compiled my program with this commented out, and it works, but without the CPropertySheet of course.
My question is: what's going wrong here?