vc程序退出报错!
int CTaskBarDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) { ......
m_ptoolBar->Create(IDD_TOOLBAR,this);
m_ptoolBar->ShowWindow(SW_SHOW);
m_pdatagram->Create(IDD_DIALOG_VIEW,this);
return 0;
}
void CToolBarDlg::OnExit()
{
::SendMessage(GetParent()->m_hWnd,WM_CLOSE,NULL,NULL);
DestroyWindow();
}
void CTaskBarDlg::OnClose()
{
m_pdatagram->SendMessage(WM_DESTROY,NULL,NULL);
delete m_ptoolBar;
delete m_pdatagram;
CDialog::OnClose();
}
退出时程序会报错,程序中有一个全局线程。