What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.
-
After closing my app the debugger reports this warning: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.
-
After closing my app the debugger reports this warning: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.
You're probably
delete
ing a modelessCDialog
without first calling itsDestroyWindow()
. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com -
You're probably
delete
ing a modelessCDialog
without first calling itsDestroyWindow()
. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com -
Ravi, Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!
Is your
CPropertySheet
class modeless? Or, do any of your property pages display modeless dialogs? Or both? /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com -
Is your
CPropertySheet
class modeless? Or, do any of your property pages display modeless dialogs? Or both? /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.comRavi, Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view. Craig
-
Ravi, Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view. Craig
When you close the view, make sure you call the property sheet's
DestroyWindow()
. This should take care of the problem. When the view gets created, do:m_pPropSheet = new CMyPropSheet (...);
ASSERT (m_pPropSheet != NULL);
m_pPropSheet->AddPage (...);
m_pPropSheet->AddPage (...);
m_pPropSheet->AddPage (...);When the view gets destroyed, do:
ASSERT (pPropSheet != NULL);
m_pPropSheet->DestroyWindow();
delete m_pPropSheet;/ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com