Print Page | Close Window

Problem with dynamic toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4321
Printed Date: 20 January 2025 at 8:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with dynamic toolbar
Posted By: Denbuerg
Subject: Problem with dynamic toolbar
Date 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?



Replies:
Posted By: Oleg
Date 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


Posted By: Denbuerg
Date 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.



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