views:

378

answers:

3

I created a string table in my .rc file containing my English strings - now I need to add another string table for a different language.

If I try to do:
Add Resource... -> String Table -> New

I get the error: "there cannot be more than one instance of this type".

I know I can open up the .rc file in notepad and add language in there but how am I suppose to do this from inside Visual Studio?

A: 

In the end, there can be only one. (sorry, I couldn't resist).

It will let you add a table if it isn't the same language as the current table, Try changing the language on your current string table to something else "Basque" maybe, then add the new table, then change it back.

John Knoeller
If you change the language of the copy back, it will be merged with the original one.
Mihai Nita
I didn't say to make a copy.
John Knoeller
+3  A: 

Yes, it is very well hidden. Double-click the .rc file in Solution Explorer to open the Resource View window. Expand the String Table node, right-click "String Table" and select "Insert Copy". That takes you to the language selection combo.

Hans Passant
Thanks, got it!
Martin
A: 

As nobugz mentioned, you can only have on string table per language.

But back to the bigger picture: is is considered a bad practice to store several languages in one executable/dll. The "best current practice" is to have resource-only dlls, one per language. Then you have full control on what language is loaded (otherwise you let Windows do the decision for you).

Take also a look at the MUI API (http://msdn.microsoft.com/en-us/goglobal/bb978454.aspx, especially the "Getting started" section on the left)

Mihai Nita