Not getting HMENU of MDI Menu |
Post Reply |
Author | |
Makarand
Senior Member Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
Post Options
Thanks(0)
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
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |