Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Remove menu .
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Remove menu .

 Post Reply Post Reply
Author
Message
Asha Udupa View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Asha Udupa Quote  Post ReplyReply Direct Link To This Post Topic: Remove menu .
    Posted: 19 April 2004 at 6:10am

Hi

I am using the following code to remove a menu item.

 CXTPControls* pControlView  = (CXTPControls*)(GetCommandBars()->GetMenuBar())->GetCo ntrols();
  CXTPControl* pCommandNew = pControlView->FindControl(xtpControlButton, ID_DELITEM, TRUE,TRUE);
  if (pCommandNew)
  {
   pControlView->Remove(pCommandNew);
     }

After this if I try to open the same menu application crashes.

Could any one please tell is this the right wa of deleting a menu item?

Regards

Asha

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2004 at 10:47am

 CXTPControl* pCommandNew =

GetCommandBars()->GetMenuBar()->GetControls->FindCo ntrol(xtpControlButton, ID_DELITEM, TRUE,TRUE);


if (pCommandNew)
{
               pCommandNew->GetControls()->Remove(pCommandNew);
}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.172 seconds.