Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Toolbar handler not invoked

Toolbar handler not invoked

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    laiju
    wrote on last edited by
    #1

    I have addded a toolbar in the OnCreate method of CMainFrame as below if (!m_UICtrlsBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_UICtrlsBar.LoadToolBar(IDR_TOOLBAR_DRAW)) { TRACE0("Failed to OSD Controls ToolBar\n"); return -1; } But the handlers for this toolbar wont work when child windows are restored or maximized. In other words - in the presence of child view windows the message handler for the toolbar is not invoked. IF I minimize/close the child windows the handler works.I have posted this several times.I am still unable to figure out the actual problem. Please let me know if my problem is not clear. laiju

    L 1 Reply Last reply
    0
    • L laiju

      I have addded a toolbar in the OnCreate method of CMainFrame as below if (!m_UICtrlsBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_UICtrlsBar.LoadToolBar(IDR_TOOLBAR_DRAW)) { TRACE0("Failed to OSD Controls ToolBar\n"); return -1; } But the handlers for this toolbar wont work when child windows are restored or maximized. In other words - in the presence of child view windows the message handler for the toolbar is not invoked. IF I minimize/close the child windows the handler works.I have posted this several times.I am still unable to figure out the actual problem. Please let me know if my problem is not clear. laiju

      L Offline
      L Offline
      laiju
      wrote on last edited by
      #2

      have addded a toolbar in the OnCreate method of CMainFrame as below if (!m_UICtrlsBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_UICtrlsBar.LoadToolBar(IDR_TOOLBAR_DRAW)) { TRACE0("Failed to OSD Controls ToolBar\n"); return -1; } IF I close the child windows the handler works.The handler wont work if the child window is minimized or restored either. laiju

      J 1 Reply Last reply
      0
      • L laiju

        have addded a toolbar in the OnCreate method of CMainFrame as below if (!m_UICtrlsBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_UICtrlsBar.LoadToolBar(IDR_TOOLBAR_DRAW)) { TRACE0("Failed to OSD Controls ToolBar\n"); return -1; } IF I close the child windows the handler works.The handler wont work if the child window is minimized or restored either. laiju

        J Offline
        J Offline
        Jose Lamas Rios
        wrote on last edited by
        #3

        Any chance you have handlers for the same commands in either the view, frame or document of the child window? MFC's command routing give those a chance to handle commands before the main frame... -- jlr http://jlamas.blogspot.com/[^]

        L 1 Reply Last reply
        0
        • J Jose Lamas Rios

          Any chance you have handlers for the same commands in either the view, frame or document of the child window? MFC's command routing give those a chance to handle commands before the main frame... -- jlr http://jlamas.blogspot.com/[^]

          L Offline
          L Offline
          laiju
          wrote on last edited by
          #4

          I have double checked this. The command ID_VIEW_DRAWTOOLBAR is not used anywhere in the project except for calling the handler OnDrawToolBar and update handler OnUpdateDrawToolBar in the mainframe laiju

          J 1 Reply Last reply
          0
          • L laiju

            I have double checked this. The command ID_VIEW_DRAWTOOLBAR is not used anywhere in the project except for calling the handler OnDrawToolBar and update handler OnUpdateDrawToolBar in the mainframe laiju

            J Offline
            J Offline
            Jose Lamas Rios
            wrote on last edited by
            #5

            Wild guess, but I'd check if ID_VIEW_DRAWTOOLBAR happens to be defined with the same number as some other command... Otherwise, I suggest setting a breakpoint in CMDIFrameWnd::OnCmdMsg() (it's in MFC's winmdi.cpp) with a condition (nID==ID_VIEW_DRAWTOOLBAR) and following the execution from there through the debugger to see how the message is routed and where it's being handled. -- jlr http://jlamas.blogspot.com/[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups