Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Dynamic Menu in MDI are lost when use ToolkitPro
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic Menu in MDI are lost when use ToolkitPro

 Post Reply Post Reply
Author
Message
hikaroute View Drop Down
Groupie
Groupie


Joined: 05 September 2007
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote hikaroute Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Menu in MDI are lost when use ToolkitPro
    Posted: 02 November 2007 at 12:18am
When I use ToolkitPro in my MDI Application, after I add Frame & Status Bar ->
 
 
That mean this menu is still hear but it's not show in the correct position, I have to use the "CXTPCommandBar* pMenuBar" to enable my menu.  But my menu is the dynamic menu, I don't use it from the menu resource.  How can I write the source code to do it?  Because if I use the standard source code like this
----------------------------------------------------------------------------
CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(
     _T("Menu Bar"), IDR_MAINFRAME);
if(pMenuBar == NULL)
{
     TRACE0("Failed to create menu bar.\n");
     return -1; // fail to create
}
pMenuBar->SetFlags(xtpFlagAddMDISysPopup);
----------------------------------------------------------------------------
It will use only from the menu resource. But I need to enable my own current menu.
 
Thank you.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 02 November 2007 at 1:53am
Hello,
 
You have use CXTPCommandBar* pMenuBar instead your custom menu. You can create whle pMenuBar in code dynamically without using resources. or convert it from hMenu:
pMenuBar->LoadMenu(pMenu);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
hikaroute View Drop Down
Groupie
Groupie


Joined: 05 September 2007
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote hikaroute Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2007 at 4:51am
Hello oleg,
I try to create the menu in the time my dynamic menu are created by use the above source code but it still use from IDR_MAINFRAME.  Or If I can use LoadMenu(); function, how can I get the current Menu from my app?
 
Thank you.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 02 November 2007 at 10:32am

Hello,

Show code you tried.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
hikaroute View Drop Down
Groupie
Groupie


Joined: 05 September 2007
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote hikaroute Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2007 at 7:14am
My major problem is the MDI application I'm working is too complex.  After I use CXTPMenuBar from Xtreme ToolkitPro, the first time users run app but the menu don't update, but if the users call the new file command (from menu file->new then files are 2) the menu can update to the correct menubar.  But it show the updated menubar always when I run it without XTP.  or if I use XTP without CXTPMenuBar like the picture I showed you in the first post.
 
Did you ever meet the case like mine?
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.031 seconds.