What you need is a Stringtable.
..DLLs aren't just for code, they hold data as well.
Create a resource DLL for each language.
In the .RC file you need something like
#define IDS_HELLO 1
#define IDS_WORLD 2
STRINGTABLE
{
IDS_HELLO, "Hello"
IDS_WORLD, "World"
}
Of course the variable names can be in any language you like, which is
both good and bad. I once had to deal with an app whose variables were
in Dutch.
There is an API cunningly called "LoadString" and you will also need
LoadLibrary.
Most examples assume you're loading strings from your own EXE, so watch
out for that.
Also, having worked for German firms, I'm aware that you may well have
English (or other) speakers on a German installation of Windows.
I find it's best to default to the install language, but have a highly
visible option that allows them to change. Also you should always
install both language versions of the DLL.
Also, if you're going to communicate with a user, you want it to have
the default for *that* user, not the system's nationality. Try
something like
My Computer\HKEY_CURRENT_USER\Control Panel\International\sCountry
in the registery.
I know you're starting off with a console app, but one thing to be
aware of is that for most things almost all languages take more
characters to say the same thing than English.
Thus you should make the fields in your dialog boxes bigger. It's very
very much easier to do this when you first build the application than
to fix this later.
DominiConnor
DCFC The Pimp
Imran wrote:
Hello all
I am planning to write a win32 console application which has needs to
run on English and German windows OS.
Can you please help me to start , Thank yoyu
Best Regards,