mfc里面MDI项目自动生成的两个菜单,有文档时菜单是一个,没菜单后又变为另一个! 
我想分别获取两个菜单指针然后动态修改,该在哪里或事件里GetMenu?想了一天了,哭啊!
别告诉我什么SetMenu,关键是在哪里!

解决方案 »

  1.   


    HMENU CMainFrame::NewMenu()
    {
      static UINT toolbars[]={
        IDR_MAINFRAME,
    IDR_TOOLBAR1
      };  // Load the menu from the resources
      // ****replace IDR_MENUTYPE with your menu ID****
      m_menu.LoadMenu(IDR_DEMOTYPE);  //菜单又变为另一个…………
      // One method for adding bitmaps to menu options is 
      // through the LoadToolbars member function.This method 
      // allows you to add all the bitmaps in a toolbar object 
      // to menu options (if they exist). The first function 
      // parameter is an array of toolbar id's. The second is 
      // the number of toolbar id's. There is also a function 
      // called LoadToolbar that just takes an id.
      m_menu.LoadToolbars(toolbars,2);  return(m_menu.Detach());
    }