Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > General Discussion
  New Posts New Posts RSS Feed - Not getting HMENU of MDI Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Not getting HMENU of MDI Menu

 Post Reply Post Reply
Author
Message
Makarand View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote Makarand Quote  Post ReplyReply Direct Link To This Post Topic: Not getting HMENU of MDI Menu
    Posted: 08 March 2007 at 1:41am
Hello,
 
I have created MDI application with MDI menu by using following code
 
if (!InitCommandBars())
  return -1;
    
CXTPCommandBars* pCommandBars = GetCommandBars();
 if(pCommandBars == NULL)
 {
  TRACE0("Failed to create command bars object.\n");
  return -1;      // fail to create
 }
 // Add the menu bar
 CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(
  _T("Menu Bar"), IDR_MAINFRAME);
 if(pMenuBar == NULL)
 {
  TRACE0("Failed to create menu bar.\n");
  return -1;      // fail to create
 }
 
Now I want to get the hendle of MDI menu.
I have used following code for the same
 
HMENU hMenu = GetMenu()->GetSafeHmenu();
 
or
 
CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd();
CMenu * pMenu = pFrame->GetMenu();
 
But I am getting NULL value.
 
How do I get the HMENU of the MDI Menu?
 
Please Help me
 
Thanks,
Makarand
 
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.141 seconds.