Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC
  New Posts New Posts RSS Feed - Localizing resources breaks CodeJock
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedLocalizing resources breaks CodeJock

 Post Reply Post Reply
Author
Message
niry View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2010
Location: Israel
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote niry Quote  Post ReplyReply Direct Link To This Post Topic: Localizing resources breaks CodeJock
    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
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: 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
Back to Top
niry View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2010
Location: Israel
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote niry Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
niry View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2010
Location: Israel
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote niry Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
niry View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2010
Location: Israel
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote niry Quote  Post ReplyReply Direct Link To This Post 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

20100901_030014_CodeJock.rar
Nir
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.156 seconds.