How to choose which STRINGTABLE resource will be compiled 
Author Message
 How to choose which STRINGTABLE resource will be compiled

Hello, I have two stringtables in my VC++ 6.0 (non-MFC) project: english and
french.
(with same IDS_xxx). Which setting should I change to choose, which version
will be compiled
and linked into my EXE?
Thank you.


Mon, 18 Jul 2005 23:44:52 GMT  
 How to choose which STRINGTABLE resource will be compiled
Hello, George!
You wrote  on Thu, 30 Jan 2003 16:44:52 +0100:

 GW> Hello, I have two stringtables in my VC++ 6.0 (non-MFC) project: english and
GW> french.
GW> (with same IDS_xxx). Which setting should I change to choose, which version
GW> will be compiled
GW> and linked into my EXE?

If I'm not mistaken both resources will be a part of your executable. Application will
use resource subset depending on locale settings:
- French in French locale;
- English in English (and other non-French) locale(s).

GW> Thank you.

???? ??



Wed, 20 Jul 2005 01:18:59 GMT  
 How to choose which STRINGTABLE resource will be compiled

Quote:

>Hello, I have two stringtables in my VC++ 6.0 (non-MFC) project: english and
>french.
>(with same IDS_xxx). Which setting should I change to choose, which version
>will be compiled
>and linked into my EXE?
>Thank you.

If you put them both in the resource script (.rc file), they both get
compiled in, and the OS will select the "right" one based on its
language settings when you call LoadString.

Unfortunately, the rules for which language is used are arcane and
inadequately documented.  Worse, each Win32 OS deviates from what the
documentation says, and the deviations are different for each
combination of OS and resource type.

You can use functions like FindResourceEx and LoadResource to load them,
and this will remove this problem.  Because you have to specify which
language to use, and it only looks for exact matches (unless you specify
the "don't care" value), you can control the search order.

--
SteveR

Populus vult decipi et decipietur.
    (The public wants to be deceived and will be.)



Wed, 20 Jul 2005 16:16:56 GMT  
 How to choose which STRINGTABLE resource will be compiled
Oh thank you, but is there any way to change some settings in
my project (or define a #define), to ensure that only 1 table
will be linked? (And then I, changing this setting, can compile the version
I want).



Quote:

> >Hello, I have two stringtables in my VC++ 6.0 (non-MFC) project: english
and
> >french.
> >(with same IDS_xxx). Which setting should I change to choose, which
version
> >will be compiled
> >and linked into my EXE?
> >Thank you.

> If you put them both in the resource script (.rc file), they both get
> compiled in, and the OS will select the "right" one based on its
> language settings when you call LoadString.

> Unfortunately, the rules for which language is used are arcane and
> inadequately documented.  Worse, each Win32 OS deviates from what the
> documentation says, and the deviations are different for each
> combination of OS and resource type.

> You can use functions like FindResourceEx and LoadResource to load them,
> and this will remove this problem.  Because you have to specify which
> language to use, and it only looks for exact matches (unless you specify
> the "don't care" value), you can control the search order.

> --
> SteveR

> Populus vult decipi et decipietur.
>     (The public wants to be deceived and will be.)



Thu, 21 Jul 2005 05:47:56 GMT  
 How to choose which STRINGTABLE resource will be compiled

Quote:

>Oh thank you, but is there any way to change some settings in
>my project (or define a #define), to ensure that only 1 table
>will be linked? (And then I, changing this setting, can compile the version
>I want).

You use #ifdef in the resource script, and /d on the resource compiler
command line:

#ifdef USE_ENGLISH
IDS_FRED STRINGTABLE ...
#endif
#ifdef USE_FRENCH
IDS_FRED STRINGTABLE ...
#endif

To compile for English:
rc ... /d USE_ENGLISH

To compile for French:
rc ... /d USE_FRENCH

To add the /d values from the IDE, choose "project settings" (Alt+F7)
and add the symbols you want to the "preprocessor definitions" box
(comma separated list) in the "resources" tab.

Don't edit this resource script with the Visual C++ resource editing
tools.  They will succeed in mangling it.

Quote:



>> >Hello, I have two stringtables in my VC++ 6.0 (non-MFC) project: english
>and
>> >french.
>> >(with same IDS_xxx). Which setting should I change to choose, which
>version
>> >will be compiled
>> >and linked into my EXE?
>> >Thank you.

>> If you put them both in the resource script (.rc file), they both get
>> compiled in, and the OS will select the "right" one based on its
>> language settings when you call LoadString.

>> Unfortunately, the rules for which language is used are arcane and
>> inadequately documented.  Worse, each Win32 OS deviates from what the
>> documentation says, and the deviations are different for each
>> combination of OS and resource type.

>> You can use functions like FindResourceEx and LoadResource to load them,
>> and this will remove this problem.  Because you have to specify which
>> language to use, and it only looks for exact matches (unless you specify
>> the "don't care" value), you can control the search order.

>> --
>> SteveR

>> Populus vult decipi et decipietur.
>>     (The public wants to be deceived and will be.)

--
SteveR

Populus vult decipi et decipietur.
    (The public wants to be deceived and will be.)



Thu, 21 Jul 2005 16:24:26 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. yes I am willing to

2. Bug: Adding a new string in stringtable creates duplicates in resource.h

3. 1 StringTable Resource, multiple lines?

4. Relationship betweek resource.h and the StringTable

5. STRINGTABLE and resource conditions

6. Using strings from the Resource StringTable

7. how to chose which OS to compile for

8. Help compiling templated class -- Am I missing something?????

9. I AM WILLING TO PAY, PLEASE READ AND HELP ME!!!

10. I am new to programming and am lost

11. Embedded resource compiled with default namespace

12. Resource file always compiled...

 

 
Powered by phpBB® Forum Software