Print Page | Close Window

Dynamic Menu in MDI are lost when use ToolkitPro

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8642
Printed Date: 14 November 2025 at 3:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dynamic Menu in MDI are lost when use ToolkitPro
Posted By: hikaroute
Subject: Dynamic Menu in MDI are lost when use ToolkitPro
Date 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.



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


Posted By: hikaroute
Date 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.


Posted By: Oleg
Date Posted: 02 November 2007 at 10:32am

Hello,

Show code you tried.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: hikaroute
Date 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?



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