Print Page | Close Window

MultiLanguage support

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6961
Printed Date: 03 March 2025 at 12:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MultiLanguage support
Posted By: sharath
Subject: MultiLanguage support
Date Posted: 24 April 2007 at 4:28am
Hi,
I am trying to load multiple langauge in my application. I have created xml file which will contain the resource string.
!XTPResourceManager()->SetResourceManager(new CXTPResourceManagerXML(strPath))

is returning false the path points correctly to the XML file path.

please help

Thanks,
Sharath B



Replies:
Posted By: Oleg
Date Posted: 24 April 2007 at 7:17am

hello,


Call AfxOleInit before you use XML.


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


Posted By: sharath
Date Posted: 24 April 2007 at 7:58am
I have add the AfxOleInit() but the problem exists.
Should I also have a resource dll along with the xml file


Posted By: sharath
Date Posted: 25 April 2007 at 4:13am
HI Oleg,

Can please let me know how to create multilanguage resource for a new application. I saw the Scribble sample but was unable to duplicate the same in my sample application.

A step by step procedure for creating the multilangauge resource would be really helpfull.

Thanks
Sharath


Posted By: Oleg
Date Posted: 25 April 2007 at 6:49am
Hi,
 
Instead XML you can use DLL files. Check folder ScribbleMultiLang\Translations\Source  - you need create rc file for each resource and build corresponded dll. After you can load this dll with
 
XTPResourceManager()->SetResourceFile("PathToDll.dll");
 


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


Posted By: Arne Ingdén
Date Posted: 25 May 2007 at 6:26am
On a related note, while checking out the ScribbleMultiLang sample project, I noticed that the AFX_IDS_IDLEMESSAGE (57345) and ID_CONTEXT_HELP (57669) strings do not use the translated versions, regardless of whether the xml or dll resource is used.
I did change the project to use the Unicode charset rather than multibyte, if that could have made an impact.
I was using VS2005 with SP1 installed when building the project.

Is this a general feature, or is it something specific to that particular sample application?

Regards,
Arne I


Posted By: Oleg
Date Posted: 25 May 2007 at 8:39am
Hi,
AFX_IDS_IDLEMESSAGE/ID_CONTEXT_HELP   are MFC strings. you need switch MFC resource handlers - AfxSetResourceHandle


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


Posted By: Arne Ingdén
Date Posted: 01 June 2007 at 4:55am
Ok, but that would mean you will not be able to use the xml language files in conjunction with MFC resource strings if you want a fully localized application?
Wouldn't it be nice if CXTPResourceManagerXML and related stuff could extract MFC strings into a temporary resource dll (i.e. created in the user's temp folder when e.g. XTPResourceManager()->SetResourceManager is called) and automatically use AfxSetResourceHandle on that?
But maybe that's beyond the scope of the toolkit?


Posted By: Oleg
Date Posted: 01 June 2007 at 7:35am
Hello,
 
Some resources are loaded in MFC sources and we can't replace them.
 
For AFX_IDS_IDLEMESSAGE  you can override
void CFrameWnd::GetMessageString(UINT nID, CString& rMessage) const
(see MFC sources)
and instead AfxLoadString(nID, lpsz)    use XTPResourceManager()->LoadString.
it will load string from XMl/DLL.


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



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