I have created a CPropertySheet-based modal dialog in MFC (using BCGSoft classes derived from CPropertySheet / CPropertyPage). When a user takes a certain action in one of the CPropertyPage‘s, I would like to enable/disable a control in a different CPropertyPage.
This works just fine, assuming the user has already clicked on the tab to instantiate the second CPropertyPage. However, MFC delays the creation of the second CPropertyPage until it is activated by the user. In this scenario, the control within the second CPropertyPage does not exist, and MFC throws an error.
To overcome this, I would like to ensure that all CPropertyPage‘s exist by calling the necessary functions within the CPropertySheet OnInitDialog(). Can someone please explain how to do this?
Calling the function
CPropertyPage::SetActivePage()(on an actualCPropertyPageobject, of course) does the trick.