Suggestion: re image managers |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Just call XTPImageManager()->InternalAddRef() after such operations.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
thanks I'll try that.
|
|
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 |