Solved

Load different language strings

Posted on 2003-10-24
6
381 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now