0

How do I go about localizing multiple .rc files in Visual studio for Win32 Projects? I have followed the tutorial here http://multilingualui.blogspot.co.uk/ which describes how to localize win32 Solution for 2 languages: English (United States) and French (France) which are applied to projects en-US and fr-FR respectively. However, each of the projects has only one resource file: en-US.rc and fr-FR.rc respectively. It is unclear to me though, what I should change if I have 2 or more resource files per language, for example, en-US.rc, en-US2.rc, fr-FR.rc and fr-FR2.rc. When I try to create these additional .rc files and place a STRINGTABLE resource in them, and then build the project, I get the error:

1>CVTRES : fatal error CVT1100: duplicate resource. type:MUI, name:1, language:0x0409 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

I tried changing TLBID:id value to other than 1, as it is the proposed solution to this problem, however it doesn't fix the problem.

Any help would be appreciated.

  • Avoid getting too fancy with resource files, the tooling dates from the stone age. 25 years is a lot of dog years in software development. You hope it will merge the string tables for you, it doesn't know how to do that. Just keep them in one .rc file. You can use the #include directive if necessary to keep files separate. – Hans Passant Jun 28 '13 at 10:38
  • I will try that, thanks for the answer. I was just looking for a smooth transition of our old project which has >50 .rc files (they are unlocalized, work for only one (English) language) to a project that would be multilinguial (need to support Japanese in my case as well). – Anton Smyrnov Jun 28 '13 at 13:04

2 Answers2

0

We have multiple DLL projects in our solution, each one containing just one set of resources. At run-time InitInstance(), we select the appropriate language DLL with code like

hInst_aRes = LoadLibrary(sResourceDllName);
if (hInst_aRes == NULL)
{    // handle <resoure-DLL not available>
     return FALSE;
}
AfxSetResourceHandle(hInst_aRes);

and use hInst_aRes to load strings, dialog boxes, ...

Edward Clements
  • 5,040
  • 2
  • 21
  • 27
0

Okay, I followed the tutorial here http://msdn.microsoft.com/en-us/library/windows/desktop/ee845043(v=vs.85).aspx and it works for multiple .rc files as well.