Print Page | Close Window

Suggestion: re image managers

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=13956
Printed Date: 13 September 2025 at 4:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Suggestion: re image managers
Posted By: adrien
Subject: Suggestion: re image managers
Date 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.


-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: Oleg
Date Posted: 09 April 2009 at 3:37am
Hi,
 
Just call XTPImageManager()->InternalAddRef() after such operations.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: adrien
Date Posted: 09 April 2009 at 6:48am
thanks I'll try that.

-------------
http://www.wingate.com - http://www.wingate.com



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