OK,
I have two recources, german and english in one *.rc file. The application chooses depending on the windows version, which languge to take. But now I want to test my changed english texts on my german windows? What do I need to do?
Thanks!
Marc
Printable View
OK,
I have two recources, german and english in one *.rc file. The application chooses depending on the windows version, which languge to take. But now I want to test my changed english texts on my german windows? What do I need to do?
Thanks!
Marc
The most common way of doing this is compile the 2 resources in to 2 dlls. and use AfxSetResourceHandle to set your language specific resource.
[ccode]
HINSTANCE hCurInstanceRes = LoadLibrary("yourGermanResource.dll");
if(m_hCurInstanceRes)
{
// Set as resource library
AfxSetResourceHandle(m_hCurInstanceRes);
}
[/ccode]
Another solution is to call SetThreadLocale at application startup (for example in InitInstance).
This function sets the locale of your application / main thread to the language of your choice and causes MFC to use the corresponding resource block.
For example you can have a command line parameter to specify the language, parse the parameter in InitInstance and call SetThreadLocale with the corresponding LCID.
Thanks!
I tried alpha137's way and made a working test-program under win2k. I took this way because it seems to be the easiest way for my in the moment: I do not need to create a DLL.
Currently I'm trying to implement this into my major projecton my win98-pc, but I think I'll need some more time.
Thanks to both of you!
Marc
Hi together!
The SetThreadLocale() works - as Microsft says in MSDN- only on win 2000´and XP. It works at least not under win98.
Do you have another idea?
thanks!
Marc
You could try to change the default System Locale on Win98, but I'm not sure how to do that... :/
The better way is really to have resource-only DLL's for the different languages like IndikaNiva suggested.