Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Possible bug using CXTPCommandBars::GetToolBar()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Possible bug using CXTPCommandBars::GetToolBar()

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Possible bug using CXTPCommandBars::GetToolBar()
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.