![]() |
CXTPMarkupContext local image manager SAFE TO USE? |
Post Reply ![]() |
Author | |
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() 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... |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
yes, its safe, but you assign new CXTPImageManager created duynamically ->m_pImageManager = new CXTPImageManager(); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg,
Why he can not use the global ImageManager ? ->m_pImageManager = XTPImageManager(); ->m_pImageManager->InternalAddRef(); Jimmy |
|
![]() |
|
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg,
Please do so. I'm waiting for this. Still open in the latest version. Thanks. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
There is SetImageManager at least in15.1.2 / 15.1.3.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
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 |