Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Need to remove a sub-menu item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Need to remove a sub-menu item

 Post Reply Post Reply
Author
Message
71SoCal View Drop Down
Newbie
Newbie


Joined: 15 April 2008
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote 71SoCal Quote  Post ReplyReply Direct Link To This Post Topic: Need to remove a sub-menu item
    Posted: 02 May 2008 at 7:32pm
How do I delete a sub-menu item?
 
I'm talking about a sub-menu item from a standard dropdown menu (menu item cascades to the right-side with an arrow indicating a sub-menu).
 
Once I've got the CXTPControl* object for the menu item, if I do the following code, it blows up:
 
 
// Get the control object from the menu item
CXTPControl* pControl = pControls->GetAt(nIndex);
if (pControl)
{
   // Trying here to get the sub-menu controls...
   CXTPControls* pSubMenuControls =
   pControl->GetCommandBar()->GetControls();  // Blows up!!!
}
 
My plan was to get the pSubMenuControls object, then call:
CXTPControl* pSubControl = pSubControls->FindControl(nID);
if (pSubControl)
{
   pSubControls->Remove(pSubControl);
}
 
Thanks for any help on this one!
 
Mike

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.