Localizing resources breaks CodeJock |
Post Reply |
Author | |
niry
Newbie Joined: 30 August 2010 Location: Israel Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 30 August 2010 at 7:44am |
Hi everyone,
I have a MFC SDI application that uses CodeJock for which I want to localize all resources. I have created a dedicated resource dll and moved all resources from executable into this dll. On the CWinApp derived application object InitInstance() method I call ::AfxSetResourceHandle() to notify the application to load all of its resources from the resources dll. Code compiles successfully, however, for some reason, during initialization (when the frame window is created) I see that a Code Jock control tries to load its resources template from the executable image rather than the resource dll by calling ::AfxGetInstanceHandle(). Obviously, InitInstance() fails. I follow the same steps for an MFC SDI based application that does not use CodeJock and localization works smoothly Idea anyone? Thank you |
|
Nir
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You can add toolkit resources to same dll - add #include "XTToolkitPro.rc" and can define before #define _XTP_RESOURCE_LANGUAGE he to include Hebrew version instead English. and in code add XTPResourceManager()->SetResourceHandle(hYourDllHandle); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
niry
Newbie Joined: 30 August 2010 Location: Israel Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Oleg,
First of all thank you for the swift reply. This hasn't solve the issue for me; I followed your instruction by adding XTPResourceManager()->SetResourceHandle() to my InitIstance() On the resources DLL project I have added: #include "XPToolkitPro.rc" in my rc2 since I use localized DLL for English I do not need to define the _XTP_RESOURCE_LANGUAGE macro when I run the application I get a CodeJock assertion "Error Locating Office2007 Resources" although I include this resource on my rc2 file (that's right ... I use Calendar controls), further more on CMainFrame::Create(), code fails to create a CDialogBar control ... for some reason the resource template can not be loaded from the resource DLL image Thanks again |
|
Nir
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
For calendar you also need #include "Styles\Office2007Blue\Office2007Blue.rc" try add it first to exe and rc2. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
niry
Newbie Joined: 30 August 2010 Location: Israel Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Hi
I have already had the #include statement in my resource DLL's rc2 file ... I got the assertion regardless of that. When I added the include statement in my exe resources it helped removing the CodeJock assertion, however the creation of MainFrame still fails. For some reason the resource template for a CDialogBar control is not loaded ... Oleg, if you have the time I can instruct you on how to easily reproduce the issue using one of CodeJock's available samples Thanks and regards. |
|
Nir
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Modify our sample and attach changes here or in issue track. It will be faster. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
niry
Newbie Joined: 30 August 2010 Location: Israel Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Hi there Oleg,
Here is the solution attached ... I use Visual studio 2005 and CodeJock 13.0.1 The solution is based on CodeJock's CalendarDemo sample Thanks and regards 20100901_030014_CodeJock.rar |
|
Nir
|
|
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 |