Print Page | Close Window

Localizing resources breaks CodeJock

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Visual C++ MFC
Forum Description: Topics related to Codejock Visual C++ MFC products
URL: http://forum.codejock.com/forum_posts.asp?TID=17173
Printed Date: 25 April 2024 at 2:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Localizing resources breaks CodeJock
Posted By: niry
Subject: Localizing resources breaks CodeJock
Date 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



Replies:
Posted By: Oleg
Date Posted: 30 August 2010 at 11:55am
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


Posted By: niry
Date Posted: 31 August 2010 at 7:30am
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


Posted By: Oleg
Date Posted: 31 August 2010 at 10:17am
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


Posted By: niry
Date Posted: 31 August 2010 at 10:59am
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


Posted By: Oleg
Date Posted: 01 September 2010 at 2:35am
Hi,

Modify our sample and attach changes here or in issue track. It will be faster.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: niry
Date Posted: 01 September 2010 at 3:00am
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

uploads/20100901_030014_CodeJock.rar - 20100901_030014_CodeJock.rar

-------------
Nir



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net