Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - (SOLVED) Resource Management EXE <-> Regular DLL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

(SOLVED) Resource Management EXE <-> Regular DLL

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: (SOLVED) Resource Management EXE <-> Regular DLL
    Posted: 03 April 2017 at 7:05am
Hello;

I'm just facing a problem with the toolkit 17.3.0 when used in an application and a regular DLL (using MFC in a shared library in both projects), when both are depending on command bars and the regular DLL is dynamically loaded/unloaded during runtime.

The app and DLL are both using all kinds of commandbar objects, docking panes, ...

When the library is loaded a non modal dialog box is created and displayed. The probleme here is, that the string resources for the DLL based dialog are by mistake loaded from the main app and not from the DLL (partly duplicate IDs). Therefore I tried to call XTPResourceManager()->SetResourceHandle() to set the resource handle to the DLL. When the dialog is closed, the library is unloaded too! That's a customer requirement!

Now, the resource handle of the XTPResourceHandle singleton is still pointing to the DLL and crashes are likely to happen. While the dialog box is shown, the resource instance handle is always pointing to the DLL. I don't know whether this may result in problems within the main app or not?

How can I solve this situation in a correct way? Is there a way to auto switch the resource handle (something like AFX_MANAGE_STATE)?
BTW: Renumbering all DLL resources to be unique for the app and the DLL is not an option, since the DLL is used in several other applications, that we are not responsible for (no code).

BTW: This design almost always result in app crashed when closing the app - due to problems with skinning. But this I already asked in a different thread.
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
sharky72 View Drop Down
Newbie
Newbie
Avatar

Joined: 05 November 2016
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharky72 Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2017 at 5:35am
Look at CXTPResourceManager::CManageState::CManageState()
it may be help.
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (1) Thanks(1)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2017 at 8:38am
Hi;

Just solved it by myself. Got the necessary hints in MSDN example DLLScreenCap.
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.