GetMenu doubt in commandbar? |
Post Reply |
Author | |
Ashok
Senior Member Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Posted: 14 January 2008 at 6:58am |
Hi,
What is the equivalent code for this statement in the CommandBar
m_pMainWnd->GetMenu(); because it returns NULL in my application. Please help. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, There is no HMENU in CommandBars.
use GetCommandBars()->GetMenuBar() to get pointer to menubar. but its not CMenu.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mihey
Groupie Joined: 14 May 2003 Location: Germany Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Hi Ashok, You are not the first one who ask about this. Maybe Codejock guys have to consider making a solution for this.
In XTPCommandBar.h I added member HMENU m_hLoadedMenu; In XTPCommandBar.cpp I added before return BOOL CXTPCommandBar::LoadMenu(CMenu* pMenu, BOOL bRemoveControls) { … // ---- if (bRemoveControls) m_hLoadedMenu=pMenu->m_hMenu; // ---- return TRUE; } In XTPMenuBar.h I just defined method CMenu* GetMenu( ) const; And added the implementation in XTPMenuBar.cpp CMenu* CXTPMenuBar::GetMenu() const { return CMenu::FromHandle(m_hLoadedMenu); } So, now I can acces loaded menu via GetCommandBars()->GetMenuBar()->GetMenu() and it works fine for me but I have to pach it in each new version of XTP. Of course this is not a universal method but at least it works in case of loading menus from recourses. Best regards, Mikhail
|
|
Ashok
Senior Member Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
|
Hi, Thanks a lot.
|
|
Ashok
Senior Member Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
|
I have uploaded a file which contains my doubt.please look into this issue.uploads/20080205_070302_test.rar
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Most our samples in CommandBars forlder show MDI/Default menus.
Please look all CommandBars samples.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Ashok
Senior Member Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
|
Hi, I understand that all your commandbar samples are having MDI Menu. My problem is when ever there is a MDIActive(means window list will have Data1,Page1etc.,),I have to set my full menu, if there is nothing in the window list(means if i closed all my active view) I have to set another menu. Please help.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Yes and our samples show it. Seriously 120 messages and you have no idea what CommandBars can do. Please check all samples and try to understand how they work.
|
|
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 |