Adding multilanguage support
-
Hi world... What is the most useful way to change language in an application? I've read we can do that with explicit link for DLL (one DLL for each languages ressource). Example: - exported from french.dll file:
extern "C" __declspec(dllexport) char* get_text(int id_text);
- int the application:
typedef char* (MY_FUNCTION)(int);
HINSTANCE hInstance;
MY_FUNCTION *pFunction;
VERIFY(hInstance = ::Loadlibrary("c:\\winnt\\system32\\french.dll"));
VERIFY(pFunction = (MY_FUNCTION*) ::GetProcAddress(hInstance, "get_text"));int id_text = 5427
char* good_translation = (pFunction*)(id_text);Is that a good solution? Thanks for your suggestions... Hello World!!! :) from Raphaël
-
Hi world... What is the most useful way to change language in an application? I've read we can do that with explicit link for DLL (one DLL for each languages ressource). Example: - exported from french.dll file:
extern "C" __declspec(dllexport) char* get_text(int id_text);
- int the application:
typedef char* (MY_FUNCTION)(int);
HINSTANCE hInstance;
MY_FUNCTION *pFunction;
VERIFY(hInstance = ::Loadlibrary("c:\\winnt\\system32\\french.dll"));
VERIFY(pFunction = (MY_FUNCTION*) ::GetProcAddress(hInstance, "get_text"));int id_text = 5427
char* good_translation = (pFunction*)(id_text);Is that a good solution? Thanks for your suggestions... Hello World!!! :) from Raphaël
use string resources in your software. Don't try it, just do it! ;-)