(SOLVED) Resource Management EXE <-> Regular DLL |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
sharky72
Groupie Joined: 05 November 2016 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Look at CXTPResourceManager::CManageState::CManageState()
it may be help.
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(1)
|
Hi;
Just solved it by myself. Got the necessary hints in MSDN example DLLScreenCap. |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
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 |