|
-
March 21st, 2016, 06:29 AM
#1
Problem with using CDialog from CPropertyPage
Hi,
I have CPropertySheet which contain multiple CPropertyPage as tabs. In one of the CPropertyPage i have a button and clicking on the button launches a CDialog. i am trying to get the control to CPropertyPage calling GetParent() method inside the CDialog class methods but somehow i don't get the right parent window and when i try to access the members of CPropertypage it throws Access Violation Exception.
Following is the code i have used:
CDialog *parentDialog = (CDialog *)GetParent(); // which return the CDialog as WS_POPUP style is used
CPropertyPage *parentPage = (CPropertyPage *)parentDialog->GetParent(); // trying to get the CPropertyPage from where the dialog is launched.
DResourceStateMgr dSrcStateMgr(parentPage->m_psp.hInstance); // throws Access Violation exception.
Same thing used to work in the Visual studio 2008 but when i moved to visual studio 2013 it throws exception.
Tags for this Thread
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
|