解决 Warning: calling DestroyWindow in CWnd::~CWnd OnDestroy or PostNcDestroy in derived class will no

阅读 33

2022-03-31

//在另一个窗口中创建时

CTestDlg *pDlg = new CTestDlg();

pDlg->Create(IDD_DIALOG_TEST,this);
pDlg->ShowWindow(TREU): 

在自己类中销毁

void CTestDlg::OnNcDestroy()
 {
    DestroyWindow();
     CDialogEx::OnNcDestroy();
 }

 void CTestDlg::PostNcDestroy()
 {
     CDialogEx::PostNcDestroy();
     delete this;
 }

精彩评论(0)

0 0 举报