Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Suggestion: re image managers
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Suggestion: re image managers

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: Suggestion: re image managers
    Posted: 08 April 2009 at 10:34pm
if you ever pass in the result of XTPImageManager() to a SetImageManager function, things will blow up.
 
This is because things like report controls will insist on trying to delete whatever pointer it was given.
 
There are a couple of ways around this, but the most simple one would be:
 
override InternalRelease for CXTPImageManager, check an internal variable (m_bDeleteOnClose), and if it's false, don't delete it.
 
Add a constructor for CXTPImageManager so that you can construct a static one and set the variable to false.
 
Then it's safe to call InternalRelease on the image manager returned from XTPImageManager(), and therefore you can use this in your controls without having to copy and maintain synch with the global one all the time.
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: 09 April 2009 at 3:37am
Hi,
 
Just call XTPImageManager()->InternalAddRef() after such operations.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 April 2009 at 6:48am
thanks I'll try that.
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.188 seconds.