Print Page | Close Window

Removing CXTPToolBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13493
Printed Date: 28 February 2025 at 8:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Removing CXTPToolBar
Posted By: BobWansink
Subject: Removing CXTPToolBar
Date Posted: 25 February 2009 at 8:02am
Hi,

I've hit a snag in the following situation:

we have a frame with a CXTPCommandBars in it. It contains a toolbar with some buttons. When i press one of them, I would like to remove the toolbar. I've tried to CXTPCommandBars::Remove() it, but that results in a crash.

Simply put, we want to be able to remove a toolbar when a user click on one of that toolbar's buttons. Is that possible?

Thanks in advance.

Bob


-------------
     Product: Xtreme ToolkitPro (MFC) version 13.0.0
     Platform: Windows (32bit) - XP - Vista
     Language: Visual C++



Replies:
Posted By: Oleg
Date Posted: 25 February 2009 at 8:29am

Hi,

Can't  reproduce it. In our customThemes sample add
 
void CMainFrame::OnViewOffice2007Frame()
{
 GetCommandBars()->Remove(GetCommandBars()->GetToolBar(IDR_SWITCH));
}
 
and click "Office2007 Frame" button.


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


Posted By: BobWansink
Date Posted: 27 February 2009 at 4:17am
Hi oleg,

further testing on our part revealed that we'd delete'd the controls on the bar. The subsequent Remove() then tries to delete the controls that don't exist anymore.

 


-------------
     Product: Xtreme ToolkitPro (MFC) version 13.0.0
     Platform: Windows (32bit) - XP - Vista
     Language: Visual C++



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