warning :OnDestroy or PostNcDestroy in derived class will not be called
2009-07-22 16:35
531 查看
应用程序中使用指针创建了对话框,在析构函数中使用delete时,会出现以下警告:
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
我们在释放指针的时候应该先通过对话框指针调用DestroyWindow()方法,然后再用delete删除。
CDlg::~CDlg()
{
if(m_pDlg!= NULL)
{
m_pDlg->DestroyWindow();
delete m_pDlg;
}
}
只有这样才可以把这个警告给去掉
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
我们在释放指针的时候应该先通过对话框指针调用DestroyWindow()方法,然后再用delete删除。
CDlg::~CDlg()
{
if(m_pDlg!= NULL)
{
m_pDlg->DestroyWindow();
delete m_pDlg;
}
}
只有这样才可以把这个警告给去掉
相关文章推荐
- warning :OnDestroy or PostNcDestroy in derived class will not be called
- warning :OnDestroy or PostNcDestroy in derived class will not be called
- 解决:AppMsg - Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called
- 解决 Warning: calling DestroyWindow in CWnd::~CWnd OnDestroy or PostNcDestroy in derived class will not be called
- Warning: calling DestroyWindow in CWnd::~CWnd OnDestroy or PostNcDestroy in derived class will not be called
- 出现“OnDestroy or PostNcDestroy in derived class will not be called.”问题
- OnDestroy or PostNcDestroy in derived class will not be called.
- 解决 Warning: calling DestroyWindow in CWnd::~CWnd OnDestroy or PostNcDestroy in derived class will n
- Classpath entry org.maven.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published
- 关于Classpath entry /XX/xx.jar will not be exported or published.警告的消除
- Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published
- Classpath entry *.jar will not be exported or published类警告处理方法
- UserWarning: The installed version of numexpr 2.4 is not supported in pandas and will be not be used
- Maven-010-maven 编译报错:Failure to ... in ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced.
- Failure to find xxx in xxx was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced @ xxx
- viewDidAppear/viewWillAppear in UINavigationController not be called
- Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published
- Deprecated: Methods with the same name as their class will not be constructors in a future version
- maven -- 问题解决(四)警告Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published