Print Page | Close Window

CXTPTaskPanel and custom paint manager

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=12315
Printed Date: 23 June 2025 at 9:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTaskPanel and custom paint manager
Posted By: debugx
Subject: CXTPTaskPanel and custom paint manager
Date Posted: 02 October 2008 at 4:44am
Hello All,

I created SDI application and added task panel. Now I set my custom paint manager with
CXTPTaskPanelPaintManager*            m_myPaintManager;
m_myPaintManager = new CTaskPanelPaintManagerSTANDARD1();
m_myTaskPanel.SetCustomTheme(m_myPaintManager);
Everything works fine. But...
Now I cant delete memory for m_myPaintManager. Trying to delete memory this way delete m_myPaintManager; causes exception.
Please let me know if CXTPTaskPanel deletes all memory for paint managers itself.

Thanks


-------------
"Один законник с портфелем в рукаm



Replies:
Posted By: mgampi
Date Posted: 02 October 2008 at 5:14am
Hi;

Destructor of CXTPTaskPanel calls delete m_pPaintManager, so you don't need to delete it.
I use

m_TaskPanel.SetCustomTheme(new CMyPaintManager());

to show that the paint manager is managed by the task panel class.

BTW: In my class designs I prefer to use std::auto_ptr<> to enforce that my class takes ownership of the object provided.


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

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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