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
Solved

Load different language strings

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
string initialization in java 11 115
FizzBuzz challenge 9 82
wordmultiple challenge 12 140
Work with App store 7 67
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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

792 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