Print Page | Close Window

Problem in Customize dialog Menu reset?

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=8310
Printed Date: 13 November 2025 at 9:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem in Customize dialog Menu reset?
Posted By: Ashok
Subject: Problem in Customize dialog Menu reset?
Date Posted: 05 October 2007 at 1:32am
Hi,
  I doing the code for the menu like this

// Add the menu bar

CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

if(pMenuBar == NULL)

{

TRACE0("Failed to create menu bar.\n");

return -1; // fail to create

}

Then I am loading my dynamic menu into the menu bar, some where in the code. But the problem is when I reset the menu through the customize dialog(reset button), it displays only the old menu( means its deleted my dynamic menu and it displays the IDR_MAINFRAME content). How I can restore my dynamic menu even if  I press the reset button in the customize dialog. Please help with code.



Replies:
Posted By: Oleg
Date Posted: 05 October 2007 at 2:27am
Hi,
 
After you create dynamic controls call
 
pMenuBar->GetControls()->CreateOriginalControls()


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


Posted By: Ashok
Date Posted: 05 October 2007 at 6:42am
Hi Oleg,
  It works fine. Thanks a lot.



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