Duplicate menu items in the Window CMFCMenuBar

I have ported the MFC application to the Feature pack. When I try to insert a new submenu / popup menu in the CMFCMenuBar, the menu items in the Window menu are duplicated. Please help me. I used the below code to insert a submenu.

    CMenu* pMenu;
    HMENU hMenu = m_wndMenuBar.GetHMenu();

ASSERT(::IsMenu(hMenu));
pMenu = CMenu::FromHandle(hMenu);

pMenu = pMenu->GetSubMenu(2);   
pMenu->InsertMenu(2, MF_BYPOSITION ,
    (UINT)ID_SORTING_SORTBYACCESS, _T("My Menu"));

m_wndMenuBar.CreateFromMenu(hMenu, false, true);

      

+3
mfc-feature-pack


source to share


No one has answered this question yet

Check out similar questions:

8
MFC Feature Class Menu Icons
4
Can the menu of my CMDIFrameWndEx CMFCMenuBar be manipulated?
3
Disable some context menu items if items are unchecked
3
CVSListBox notification after deletion
2
Why isn't CMFCMenuBar using the accelerator table?
1
Help me find the problem with the prompt on the CMFCMenuBar
0
CMFCPropertyGridCtrl last item not drawn?
0
How to add menu item dynamically with image in MFC featurepack
0
Resizing the docked pane in STOCK Visual Studio 2012 MFC application leaves artifacts under Windows 10, why?
0
Crash / Assertion after ForceRecalcLayout call



All Articles
Loading...
X
Show
Funny
Dev
Pics