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 );
}