Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTaskPanel and custom paint manager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTaskPanel and custom paint manager

 Post Reply Post Reply
Author
Message
debugx View Drop Down
Groupie
Groupie
Avatar

Joined: 23 June 2008
Location: Andorra
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote debugx Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTaskPanel and custom paint manager
    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
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: 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 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.172 seconds.