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

Menu Issue

 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: Menu Issue
    Posted: 06 April 2007 at 2:29am
Hi,
 
I need to assign Menu Handle to diffrent shared document template such as Spliter Window, BookView etc...
 
Below code is defind in XYZ.h, for diffrent shared document template

CSharedDocTemplate* m_pSplitWindowTempl;        // Split Window
CSharedDocTemplate* m_pBookTempl;                    // Book view

The below given code is in OnCreate() of MainFrame.cpp, where we are assigning the Menu handle to diffrent shared document template.

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

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

HMENU hMenu = GetMenu()->GetSafeHmenu();

[Since CommandBar dose not hold HMENU, We are not getting hMenu]

CXYZApp * pApp = (CXYZApp *)AfxGetApp(); 

[But we need to assign handle of menu for diffrent shared document template.]

    pApp->m_pSplitWindowTempl->m_hMenuShared = hMenu;
    pApp->m_pBookTempl->m_hMenuShared = hMenu;

}

Since we are not getting "hMenu", we are unable to assign it to diffrent shared document template. 

How we can assign handle of menu to diffrent shared document template?

 
Please help me.
 
Thank You,
Makarand,
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: 06 April 2007 at 3:15am
call
 

HMENU hMenu = GetMenu()->GetSafeHmenu();

pApp->m_pSplitWindowTempl->m_hMenuShared = hMenu;
pApp->m_pBookTempl->m_hMenuShared = hMenu;
 
before you set menubar.
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.047 seconds.