I am trying to create a context menu that lists all the buttons for each toolbar using popup submenus... something like this...
File>
___New
___Open
___Save
Edit>
___Cut
___Copy
___Paste
etc...
I create a popup menu like this...
I am trying to get a pointer to the newly created popup "submenu" so I can add menu items to it to represent each button from the toolbar...Code:CMenu menu; VERIFY(menu.LoadMenu(IDR_TOOLBAR_POPUP_MENU)); // pPopupMenu is the highest level of my context menu... CMenu* pPopupMenu = menu.GetSubMenu(0); if (pPopupMenu) { CString cstr; m_wndFileToolBar.GetWindowText(cstr); bool bSuccess = pPopupMenu->InsertMenu(0, MF_BYPOSITION | MF_ENABLED, MF_POPUP, cstr); CMenu* pSubMenu1 = pPopupMenu->GetSubMenu(0); ///////////////// pSubMenu1 is NULL at this point ... What am I doing wrong??? }




Reply With Quote