Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPMarkupContext local image manager SAFE TO USE?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPMarkupContext local image manager SAFE TO USE?

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


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: CXTPMarkupContext local image manager SAFE TO USE?
    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...


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 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
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 516
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2011 at 11:46am
Hi Oleg,

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

  Jimmy

Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2011 at 7:17am
Hi Oleg,

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

Thanks.
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: 24 August 2011 at 8:02am
There is SetImageManager at least in15.1.2 / 15.1.3.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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.
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.047 seconds.