MFC非模態對話框銷毀
睿豐德科技 專注RFID識別技術和條碼識別技術與管理軟件的集成項目。質量追溯系統、MES系統、金蝶與條碼系統對接、用友與條碼系統對接
非模態對話框需要重載OnCanel方法, 并調用DestroyWindow, 且不能調用基類的OnCanel
重載PostNcDestroy, 需要delete掉this指針
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgTest)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgTest)
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
void CDlgTest::OnOK()
{
// TODO: Add extra validation here
}
void CDlgTest::OnCancel()
{
DestroyWindow();
}
void CDlgTest::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
CDialog::PostNcDestroy();
delete this;
}
RFID管理系統集成商 RFID中間件 條碼系統中間層 物聯網軟件集成
重載PostNcDestroy, 需要delete掉this指針
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgTest)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgTest)
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
void CDlgTest::OnOK()
{
// TODO: Add extra validation here
}
void CDlgTest::OnCancel()
{
DestroyWindow();
}
void CDlgTest::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
CDialog::PostNcDestroy();
delete this;
}
RFID管理系統集成商 RFID中間件 條碼系統中間層 物聯網軟件集成