![]() |
MultiLanguage support |
Post Reply ![]() |
Author | |
sharath ![]() Newbie ![]() Joined: 21 April 2007 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
hello, Call AfxOleInit before you use XML. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
sharath ![]() Newbie ![]() Joined: 21 April 2007 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
I have add the AfxOleInit() but the problem exists.
Should I also have a resource dll along with the xml file |
|
![]() |
|
sharath ![]() Newbie ![]() Joined: 21 April 2007 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Arne Ingdén ![]() Newbie ![]() Joined: 25 May 2007 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
AFX_IDS_IDLEMESSAGE/ID_CONTEXT_HELP are MFC strings. you need switch MFC resource handlers - AfxSetResourceHandle
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Arne Ingdén ![]() Newbie ![]() Joined: 25 May 2007 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
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 |