Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - MultiLanguage support
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MultiLanguage support

 Post Reply Post Reply
Author
Message
sharath View Drop Down
Newbie
Newbie


Joined: 21 April 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharath Quote  Post ReplyReply Direct Link To This Post Topic: MultiLanguage support
    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
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: 24 April 2007 at 7:17am

hello,


Call AfxOleInit before you use XML.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
sharath View Drop Down
Newbie
Newbie


Joined: 21 April 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharath Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
sharath View Drop Down
Newbie
Newbie


Joined: 21 April 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharath Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
Arne Ingdén View Drop Down
Newbie
Newbie


Joined: 25 May 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arne Ingdén Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
Arne Ingdén View Drop Down
Newbie
Newbie


Joined: 25 May 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Arne Ingdén Quote  Post ReplyReply Direct Link To This Post 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?
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 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
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.