Command handlers in MDI view? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 07 September 2006 at 2:07pm |
In an SDI App you simple put all command handlers (menu items etc) in your CMyView.cpp file. This is possible thanks to this: BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{ TRACE0( " CMainFrame::OnCmdMsg() entered\n" ); // let the view have first crack at the command
if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) return TRUE; // otherwise, do default handling
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); } Now, how do I do that in an MDI app (with a ribbon bar)? For instance, if a menu item says "print", I want to print the active view. That is, I want to handle this command in that very instance of the view.
Suggestions?
Thanks!
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
This is handled internally. The active view will get the first crack at the command, as far as I know.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |