Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Hierarchical menu: How?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hierarchical menu: How?

 Post Reply Post Reply
Author
Message
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post Topic: Hierarchical menu: How?
    Posted: 10 October 2008 at 4:36pm
C++:
I create a menu:
    ICommandBarPopupPtr pPopupMenu = 0;
        pPopupMenu = m_pCmdBar->ActiveMenuBar->GetControls()->Add(xtpControlPopup, 0, _bstr_t("TEST"), -1, false);
        pPopupMenu->PutId(32000);
        pPopupMenuControls = pPopupMenu->GetCommandBar()->GetControls();

Add a menu item:
            pAction = pActions->Add(101, _bstr_t("New"), _bstr_t(""), _bstr_t(""), _bstr_t("TEST));

            pControl = pPopupMenuControls->Add(xtpControlButton,  101, "");

I create another menu (as above), and want to add this first menu to it.  I iterate over the CommandBar controls to find the control with this menuname/menuid (TEST/32000), and try to add it to the new menu:
          assert(xtpControlPopup == pCtrl->GetType());
          OutputDebugString(pCtrl->GetCaption()); OutputDebugString("\n");
          // This looks like the control -- popupMenu -- that I am looking for....
          pPopupMenuControls->AddControl(pCtrl);

Unfortunately, the TEST menu does not appear on the second menu I create.
What am I doing wrong?
TIA for any advice...


Product: Xtreme SuitePro (ActiveX) version 12.1.0
Platform: Windows XP (32bit) - SP 3
Language: C / C++

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: 13 October 2008 at 6:19am
Hi,
You can't add again already added menu. Have to remove it first or Copy (see Copy method).
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.203 seconds.