![]() |
how to replace CMainFrame->GetMenu() in codejock |
Post Reply ![]() |
Author | |
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() Posted: 17 September 2007 at 6:33pm |
Hi,
I am using codejock to reskin the old MFC 6.0 application. Since codekock doesn't support application menu (the menu is hide in title bar), ao I create the menu bar by following the sample code.
if (!InitCommandBars())
return -1; // Get a pointer to the command bars object.
CXTPCommandBars* pCommandBars = GetCommandBars(); if(pCommandBars == NULL)
{ TRACE0("Failed to create command bars object.\n"); return -1; // fail to create } // create the menubar.
pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); if(pMenuBar == NULL) { TRACE0("Failed to create menu bar.\n"); return -1; // fail to create }
However, if I create the menu like this way, I am not able to CMainFrame->GetMenu(), the pointer is null. I have lots of code of getting main menu by this way , and corresponding methods (llike CheckMenuItem). How can I change the code to let them working?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Afraid you need rewrite it :(
Instead CMainFrame->GetMenu use
GetCommandBar()->GetMenuBar()
and use CXTPControls/ CXTPControl methods to add/remove/modify items.
|
|
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 |