![]() |
Possible bug using CXTPCommandBars::GetToolBar() |
Post Reply ![]() |
Author | |
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() 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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |