Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problem with dynamic toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with dynamic toolbar

 Post Reply Post Reply
Author
Message
Denbuerg View Drop Down
Newbie
Newbie


Joined: 14 March 2006
Location: Germany
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Denbuerg Quote  Post ReplyReply Direct Link To This Post Topic: Problem with dynamic toolbar
    Posted: 01 June 2006 at 10:59am
Hi,

I add new items to my standard toolbar like this:

CXTPControls* pControls = m_pToolBar->GetControls();
CXTPControl* pControl = new CXTPControlButton();
pControls->Add(pControl, nCommandID, NULL, nPos, TRUE);
...

But when I close my application, an exception occurs here:

DWORD CCmdTarget::InternalRelease()
{
    ASSERT(GetInterfaceMap() != NULL);
    ...

This function is called by CXTPControls::RemoveAll(void) on MainFrame destruction.

If I dont add a new Button to the toolbar, it works. What am I doing wrong?
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: 01 June 2006 at 12:31pm

Hello,

Code looks ok, Problem somewhere else... Can yo uatttach project here?

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Denbuerg View Drop Down
Newbie
Newbie


Joined: 14 March 2006
Location: Germany
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Denbuerg Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2006 at 3:01am
I found the problem.

Instead of adding the same control button I added to the menu, I created a new control button. Now it works.
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.063 seconds.