thx for the help- the problem seems to be somewhere else. it also doesn't work if i try to do it the other way round, i.e. to close the dialog from the mainFrame. to e more detailed, it works in some cases, but most of the times after i worked a little bit in the dialog, my app crashes when trying to close both. probably, somewhere in my dialog i did not free memory or something like that... here's some of my code anyway: I have a PPC app that start and shows a modeless dialog: Code: //in MainFrame.h: CComPortDlg* m_pDlg; //in MainFrame.cpp: CMainFrame::CMainFrame(){ m_pDlg = new CComPortDlg; } //when clicking menu-entry "End": if(this->m_pDlg->m_hWnd != NULL){ this->m_pDlg->ShowWindow(SW_HIDE); this->m_pDlg->DestroyWindow(); //close dialog //the destroyWindow() usually take VERY long and makes the whole PDA crash... } SendMessage(WM_CLOSE,0,0); //close mainframe //in Destructor: CMainFrame::~CMainFrame(){ delete m_pDlg; } is this the right way to deal with modeless dialogs? thx, Daniel