
Problem Closing UI thread dialog boxes from main app
Happy new year!
I have an application that create UI threads dialog boxes as steps
below.
1)
void CSysTab_EditorMainFrame::OnSearch()
{
CFindThread* pFindThread = new CFindThread(m_hWnd); //thread
dies when wnd closes
pFindThread->CreateThread();
Quote:
}
2)thread creates dialog
BOOL CFindThread::InitInstance()
{
BOOL bReturn = m_wndSearchDlg.Create(IDD_SEARCH_DLG);
m_wndSearchDlg.ShowWindow(SW_SHOW);
m_pMainWnd = &m_wndSearchDlg;
return TRUE;
Quote:
}
The problem:
if i close the main application and several dialogs are about the
threads do not die cleanly and at times the OS hangs!!!
I tried EnumChildWindows and sending WM_CLOSE (kills thread
automatically) to all child windows and their child windows but since
these dialogs are pop ups and not child windows it doesnt work.
Hope someone can figure this one out for me
Thnx in advance
Alon
Sent via Deja.com
http://www.*-*-*.com/