Print Page | Close Window

Possible bug using CXTPCommandBars::GetToolBar()

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=5925
Printed Date: 04 October 2024 at 7:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Possible bug using CXTPCommandBars::GetToolBar()
Posted By: mgampi
Subject: Possible bug using CXTPCommandBars::GetToolBar()
Date Posted: 27 December 2006 at 2:40pm

Hi;

I think I found a bug in CXTPCommandBars::GetToolBar(). What did I do?
I created a MDI child window and a additional toolbar in main frame. The child has its own menu bar and the previously mentioned toolbar with the same resource ID (IDR_MYCHILD).
The menubar and toolbar are both successfully created, but when trying to access the toolbar in code by using CXTPCommandBars::GetToolBar(IDR_MYCHILD) it always returns a pointer to the menubar.
 
Since I'm explicitely calling GetToolBar() I expect a pointer to the toolbar to be returned!
 
Maybe I missed something due to lack of documentation. So perhaps it's not a bug and I have to access the toolbar in a different way.
 
Any comment to this is very welcome...


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: Oleg
Date Posted: 28 December 2006 at 2:26am
Hi,
 
MenuBar has ID 1. So I think IDR_MYCHILD is also declared as 1 and they have same Id....


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


Posted By: mgampi
Date Posted: 28 December 2006 at 4:35am
Hi Oleg;
 
I disagree. My IDR_MYCHILD has a value of 2. I'm asking whether menubars and toolbars both share the same container inside the CXTPCommandBars object? To remember, my MDI child has its own menu and the toolbar used to act on this MDI child is created in MDI mainframe on app startup. Both controls have the same ID in common (IDR_MYCHILD).


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Oleg
Date Posted: 28 December 2006 at 3:16pm

Needs your code to see what you do. Can you attach it in issuetrack? ANywas as you can see GetToolBar it loops all toolbars and checks its id. Problem can be only if 2 toolbars have same id.



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


Posted By: mgampi
Date Posted: 28 December 2006 at 3:25pm
Hi Oleg;
As I mentioned in my previous post, the toolbar and the menubar of the MDI child window have both the same ID. The toolbar is a child of the mainframe.
When calling the CXTPCommandBars::GetToolBar() the pointer returned is a pointer to the menubar of the MDI child and not the pointer to the toolbar.
Nevertheless I will try to isolate the problem - since it happens in a huge app - and create a sample application. Perhaps I can reproduce it with one
of your sample applications...
 


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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