CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    399

    Routing messages from CView to CDockablePane

    I have a MDI app, with CView based on CEditView, and in CMainFrame, I have a CDockablePane where I stretched a CRichEditCtrl. Everything goes well, except that messages from CMyDockablePane is routed to CMyEditView, so it is not what I want, if the focus is on CMyDockablePane.

    In detail, if I go to CMyDockablePane, and try to do a "Paste", the "Paste" operation is done it in CMyEditView.

    An interesting thing: If I do "Ctrl+Shift+V", then the "Paste" operation is done in CMyDockablePane.

    My Question is, how can I route MFC commands from CMyEditView to CMyDockablePane, if I got the focus inside my CMyDockablePane ?

    I have tried this:

    Code:
    BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
    {
    	// TODO: Add your specialized code here and/or call the base class
    
    	if (m_wndClassView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))  // m_wndClassView is my CMyDockablePane
    		return TRUE;
    
    	return CMDIFrameWndEx::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
    }
    Didn't worked. I have attached here a sample project:
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured