![]() |
CXTPTaskPanel and custom paint manager |
Post Reply ![]() |
Author | |
debugx ![]() Groupie ![]() ![]() Joined: 23 June 2008 Location: Andorra Status: Offline Points: 28 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
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 |