Print Page | Close Window

CXTPMarkupContext local image manager SAFE TO USE?

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=18017
Printed Date: 18 June 2025 at 11:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPMarkupContext local image manager SAFE TO USE?
Posted By: MacW
Subject: CXTPMarkupContext local image manager SAFE TO USE?
Date Posted: 08 March 2011 at 5:44am
In a large application it is pretty hard to associate a unique "command id" with any bitmaps added to the global XTPImageManager() instance.

I noticed that the CXTPMarkupContext  has a local image manager instance (m_pImageManager) declared public. This instance is apparently never initialized (no methods found). But the markup image class checks this instance first before checking the global image manager.

I hence new the m_pImageManager in my code when I want to work with "local" bitmaps only valid in this markup context. The markup context releases the m_pImageManager automatically in the destructor.

Is this SAFE to use or does Codejock plan to remove this variable in a future update. As usual none of this is documented and I don't want to rely on guesswork.

Perhaps you can make this more official by adding a proper method to CXTPMarkupContext to create its own image manager...





Replies:
Posted By: Oleg
Date Posted: 09 March 2011 at 11:33am
Hello,

yes, its safe, but you assign new CXTPImageManager created duynamically

->m_pImageManager = new CXTPImageManager();



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


Posted By: jimmy
Date Posted: 09 March 2011 at 11:46am
Hi Oleg,

Why he can not use the global ImageManager ?
->m_pImageManager = XTPImageManager();
->m_pImageManager->InternalAddRef();

  Jimmy



Posted By: MacW
Date Posted: 09 March 2011 at 6:29pm
Hi, Oleg

yes, as I wrote, I "new" the instance in my code. But I just wanted to make sure that you don't drop the variable in a future release. This is all undocumented (as too often) and there are no methods to initialize the member properly.

Using the global image manager is not always an option, especially since every bitmap needs a globally unique id. Using the local image manager avoids polluting the global image manager.


Posted By: MacW
Date Posted: 09 March 2011 at 6:30pm
This would not help because I actually don't want to use the global image manager because I don't want to pollute the image manager identifier space.


Posted By: Oleg
Date Posted: 10 March 2011 at 5:34am
btw guess you are right that better to add public method with description, I'm adding new SetImageManager, after upgrade please use it instead.

Thanks


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


Posted By: MacW
Date Posted: 23 August 2011 at 7:17am
Hi Oleg,

Please do so. I'm waiting for this. Still open in the latest version.

Thanks.


Posted By: Oleg
Date Posted: 24 August 2011 at 8:02am
There is SetImageManager at least in15.1.2 / 15.1.3.

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


Posted By: MacW
Date Posted: 24 August 2011 at 9:01am
I see. I checked the release notes but there was no mention of any change.

I do not install every XTP update for deployment reasons so I could no t search the source codes for changes you may have made or not.



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