Print Page | Close Window

Menu Issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6810
Printed Date: 03 March 2025 at 5:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Menu Issue
Posted By: Makarand
Subject: Menu Issue
Date 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,



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net