Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Expertise: Beginner
Mar 21, 2003



Application Security Testing: An Integral Part of DevOps

Translate Your Program Easily

If you want your program to be easily translated into a different language, consider making every displayed text a resource in a dll. Every language will have its own .dll and the same text will have the same id in all dlls. Then, all you have to do at runtime is to load the right dll and get the text resources with the LoadString API:
LPSTR szLang;	//this will contain the language that should be used

char szWindowTitle[256];

wsprintf(szDll, "%s.dll", szLang);

HMODULE hDll = LoadLibrary(szDll)
LoadString(hDll, IDS_WINDOW_TITLE, szWindowTitle, sizof(szWindowTitle));


You should have several dlls: 'eng.dll', 'fr.dll', 'it.dll' —one for each language you support.
Paul Marinescu
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date