CPropertySheet CPropertyPage quirk
-
I am trying to build a property sheet with its pages instantiated in the header file of the sheet. The project builds fine, but gives an assertion error on ASSERT(afxCurrentResourceHandle != NULL) as soon as execution is attempted (in the construction of a page). This error does not occur if pages are instatiated "on-the-fly" in the body of the property sheet previous to the DoModal() call. But I need to have property page member functions visible to other classes, so they need to be predefined. Any ideas as to why it barfs on property page construction in this setting? Thanks in advance, Ben
-
I am trying to build a property sheet with its pages instantiated in the header file of the sheet. The project builds fine, but gives an assertion error on ASSERT(afxCurrentResourceHandle != NULL) as soon as execution is attempted (in the construction of a page). This error does not occur if pages are instatiated "on-the-fly" in the body of the property sheet previous to the DoModal() call. But I need to have property page member functions visible to other classes, so they need to be predefined. Any ideas as to why it barfs on property page construction in this setting? Thanks in advance, Ben
-
Constructor: CMsgETIData::CMsgETIData() : CPropertyPage(CMsgETIData::IDD) { //{{AFX_DATA_INIT(CMsgETIData) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } How I _was_ adding pages: CMsgETIData m_page2; m_DQRMsgCreateSheet.AddPage(&m_page2); m_DQRMsgCreateSheet.DoModal(); m_DQRMsgCreateSheet.RemovePage(&m_page2); How I _want_ to add pages: in the sheet header: public: CMsgETIData m_page2; in the body: m_DQRMsgCreateSheet.AddPage(&m_page2); m_DQRMsgCreateSheet.DoModal();