BOOL CFrameWnd::OnCmdMsg(UINT nID, int nCode) { CView* pView = GetActiveView(); if (pView->OnCmdMsg(nID, nCode)) { return TRUE; } if (CWnd::OnCmdMsg(nID, nCode)) { return TRUE; } CWinApp* pApp = AfxGetApp(); if (pApp->OnCmdMsg(nID, nCode)) { return TRUE; } return FALSE; }
BOOL CFrameWnd::OnCmdMsg( UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo ) /**********************************************************/ { CView *pView = GetActiveView(); if( pView != NULL && pView->OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) ) { return( TRUE ); } if( CWnd::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) ) { return( TRUE ); } CWinApp *pApp = AfxGetApp(); if( pApp != NULL && pApp->OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) ) { return( TRUE ); } return( FALSE ); }
BOOL CFrameWnd::OnCmdMsg(UINT nID, int nCode) { cout << "CFrameWnd::OnCmdMsg()" << endl; // pump through current view FIRST CView* pView = GetActiveView(); if (pView->OnCmdMsg(nID, nCode)) return TRUE; // then pump through frame if (CWnd::OnCmdMsg(nID, nCode)) return TRUE; // last but not least, pump through app CWinApp* pApp = AfxGetApp(); if (pApp->OnCmdMsg(nID, nCode)) return TRUE; return FALSE; }