Solved

Load different language strings

Posted on 2003-10-24
6
394 Views
Last Modified: 2013-11-20
Hi All,
I have a aplication that is using 2 language strings (english and norwegian) what i want to do is ... when i run  the application, i.e at the runtime , I want to load the strings from the both language string tables.... i have some tags stord in this string tables and at run time the user enters a tag ( it can be in english or in norwegian) and regardless of the users language setting i want to load both the strins .... i tried to use this .Loadstring() but it will load according to the local language. how can i load strings of both of these languages

Thankx in advance
Rijal
0
Comment
Question by:Rijal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 250 total points
ID: 9613361
Create a DLL that will store all the resource.
ie. In an empty DLL MFC project add all the resource for a particular Language.
In the similar way add DLLs for each language.

Each DLL will have resource.h. This file should be same for each DLL, only the corresponding STRINGS will change.

And in your main project, include this resource.h. For loading different languages, load the different DLLs and get this strings by setting this DLL as the Resource, Now the code....



HINSTANCE hInstance = LoadLibrary("EnglishDLL.dll");
AfxSetResourceHandle(hInstance);

//LOAD THE STRING USING *LoadString*, so you will get english resource


hInstance = LoadLibrary("NorwegianDLL.dll");
AfxSetResourceHandle(hInstance);

LoadString(----)

Now you will get the norwegian string...

Good Luck :)
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 250 total points
ID: 9613685
If you are working with VC++ 7 or later, you can use the LoadString function which has Language ID parameter. In VC++ 6 such function may be implemented using FindResource API.
0
 
LVL 1

Expert Comment

by:abdo81
ID: 9619385
Create INI file for each language you have.
Use GetPrivateProfileString to load the strings from the INI file.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question