How do I get a pointer to the propertysheet from within a propertypage.
Printable View
How do I get a pointer to the propertysheet from within a propertypage.
Declare the property sheet in a header file, then refer to it. For example:
//mainfrm.h
CPropertySheet* m_pSheet;
// mainfrm.cpp
m_pSheet.AddPage(&Page1);
m_pSheet.AddPage(&Page2);
// page1.cpp
int nIndex = ((CMainFrame* )AfxGetMainWnd())->m_pSheet->GetActiveIndex();