![]() |
Menu Issue |
Post Reply ![]() |
Author | |
Makarand ![]() Senior Member ![]() ![]() Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
![]() ![]() ![]() ![]() ![]() 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 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; } 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,
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
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 |