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. Using CMFCMenuBar with CDialog

Using CMFCMenuBar with CDialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
2 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.
  • S Offline
    S Offline
    Shashikant_2006
    wrote on last edited by
    #1

    I am upgrading my VC6 app to new mfc feature pack, I have to add a CMFCMenuBar on a dialog box, I am able to add and display the menu bar, but none of its pop up menu items work.... All the menu items in dropdwn/popup menu in menu bar are disabled and not responding to any message... after adding message handler functions, anybody has any idea?? I am posting my code to create and display menubar (CMFCMenuBar) on a dialog box here. I have tried to put this code within OnInitDialog() as well as OnCreate() function of the dialog class. m_wndMenuBar is a CMFCMenuBar object decleraed in .h file. if (!m_wndMenuBar.Create(this)) { TRACE0("Failed to create menubar\n"); return -1; // fail to create } CMenu *menu = new CMenu(); menu -> LoadMenu (IDR_ITEM_MENU); m_wndMenuBar.CreateFromMenu(menu->GetSafeHmenu(),TRUE,TRUE); m_wndMenuBar.SetDefaultMenuResId(IDR_ITEM_MENU); m_wndMenuBar.SetWindowPos(NULL,0, 0 ,500,30,SWP_SHOWWINDOW);

    Never complain,never explain,just do your work.

    G 1 Reply Last reply
    0
    • S Shashikant_2006

      I am upgrading my VC6 app to new mfc feature pack, I have to add a CMFCMenuBar on a dialog box, I am able to add and display the menu bar, but none of its pop up menu items work.... All the menu items in dropdwn/popup menu in menu bar are disabled and not responding to any message... after adding message handler functions, anybody has any idea?? I am posting my code to create and display menubar (CMFCMenuBar) on a dialog box here. I have tried to put this code within OnInitDialog() as well as OnCreate() function of the dialog class. m_wndMenuBar is a CMFCMenuBar object decleraed in .h file. if (!m_wndMenuBar.Create(this)) { TRACE0("Failed to create menubar\n"); return -1; // fail to create } CMenu *menu = new CMenu(); menu -> LoadMenu (IDR_ITEM_MENU); m_wndMenuBar.CreateFromMenu(menu->GetSafeHmenu(),TRUE,TRUE); m_wndMenuBar.SetDefaultMenuResId(IDR_ITEM_MENU); m_wndMenuBar.SetWindowPos(NULL,0, 0 ,500,30,SWP_SHOWWINDOW);

      Never complain,never explain,just do your work.

      G Offline
      G Offline
      Gan Chuanli
      wrote on last edited by
      #2

      I have the same problem.Have you solved it?

      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