|
-
November 1st, 2002, 08:21 AM
#1
Language
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
-
November 1st, 2002, 09:21 AM
#2
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]
-
November 1st, 2002, 11:52 AM
#3
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.
-
November 4th, 2002, 02:09 AM
#4
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
-
November 4th, 2002, 07:38 AM
#5
Too early
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
-
November 4th, 2002, 10:24 AM
#6
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.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|