Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Returning a HMenu of the command bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Returning a HMenu of the command bar

 Post Reply Post Reply
Author
Message
guywmustang View Drop Down
Newbie
Newbie


Joined: 17 April 2006
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote guywmustang Quote  Post ReplyReply Direct Link To This Post Topic: Returning a HMenu of the command bar
    Posted: 15 May 2007 at 5:22pm
I have my code creating the command bars using the following code:

   
CXTPCommandBars* pCommandBars = GetCommandBars();

CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);


I need to get a HMenu of the menu bars, similar to as if I used:
HMENU hmenu = GetMenu()->GetSafeHmenu();

or
HMENU hmenu = ::GetMenu(this->m_hWnd);


I have tried the following to no avail:
CXTPMenuBar* pCXTPMenuBar = GetCommandBars()->GetMenuBar();
HMENU hmenu = pCXTPMenuBar->GetMenu()->GetSafeHmenu();



Does anyone know how I can get the HMENU of my menu for my app???

I'm at a complete loss.
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: 16 May 2007 at 5:53am
Hi,
 
You can't get it. MenuBar doesn't use HMENU.
You have to call CXTPControls methods to add/remove/modify items to menu.
 
pMenuBar->GetControls()->Add(...)
etc
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.031 seconds.