Dec 5, 2001 #1 HippoTas Programmer Dec 4, 2001 15 GR I have an SDI app (derived from CFromView an I want to exit using a button. I can do that from the menu (ID_APP_EXIT) or the status bar. I tried : void CMyView::OnExit() { CFormView::OnClose(); } but i didn't work
I have an SDI app (derived from CFromView an I want to exit using a button. I can do that from the menu (ID_APP_EXIT) or the status bar. I tried : void CMyView::OnExit() { CFormView::OnClose(); } but i didn't work
Dec 10, 2001 #2 tchouch Programmer Apr 18, 2001 300 DE You can do it so: void CMyView::OnExit() { ExitProcess( 0); } or so void CMyView::OnExit() { GetParent( )->SendMessage( WM_CLOSE, (WPARAM) 0, (LPARAM) 0 ); } or so: void CMyView::OnExit() { AfxGetMainWnd()->SendMessage( WM_CLOSE, (WPARAM) 0, (LPARAM) 0 ); } Upvote 0 Downvote
You can do it so: void CMyView::OnExit() { ExitProcess( 0); } or so void CMyView::OnExit() { GetParent( )->SendMessage( WM_CLOSE, (WPARAM) 0, (LPARAM) 0 ); } or so: void CMyView::OnExit() { AfxGetMainWnd()->SendMessage( WM_CLOSE, (WPARAM) 0, (LPARAM) 0 ); }
Dec 10, 2001 Thread starter #3 HippoTas Programmer Dec 4, 2001 15 GR Thnx tchouch I used this : void CMyView::OnExit() { AfxGetApp()->CloseAllDocuments(TRUE); } Upvote 0 Downvote