Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


10 years late: MFC support

Germany

The latest version of the Multi-Language Add-In for VS 2005/2008 now has some support for unmanaged C++ projects, in particular MFC projects.

It's not as extensive as the support for .NET projects. For example, there is no real support for runtime language switching. The Add-In does not attempt to generate a function similar to the ml_UpdateControls() function in .NET projects, which could be used to update the texts in a loaded dialog.

Nevertheless, it has the basic features of detecting strings, presenting them in a grid, letting you add languages and exporting the translations to a resource file.

There are significant differences in unmanaged C++/MFC projects and managed .NET projects. Unmanaged C++ projects do not use the ResX resource format and they only have a primitive forms designer. (Steve McMahon of vbAccelerator described it simply as like a really rubbish version of VB and that was almost 10 years ago).

The central difference is the resource script (.rc) file format. This is used to describe, amongst other things, dialogs, menus and strings in multiple languages.

In Windows Forms projects, the Add-In scans Forms and UserControls for localizable string properties. The equivalent operation for unmanaged C++ projects is to read the dialog and menu resources from the .rc file. Strings from dialog and menu resources are presented in the controls grid.

Not surprisingly, there is no great difference in handling strings in the source code.

Instead of exporting the translations to the ResX format, it writes the translations back to the .rc file. For each language that is added to the project, new dialog and menu resources are generated. This is performed when you select the command Store resources for unmanaged projects (and not performed automatically).

I have described a lot of this in the web page Quick Tour (Unmanaged C++/MFC) and also in a new page in the help file, entitled Support for unmanaged C++ projects and MFC.

There is a large base of MFC projects, so there may be a lot of potential users. That is looking on the bright side. On the other hand, I doubt if many people are starting new projects using MFC. I also suspect that a lot of existing MFC projects are still using VC++ version 6, and they are not about to switch to Visual Studio 2005 or 2008.

The bottom line is, I don't know if anybody will ever use the new MFC support. If a lot of people start using it, then I will be happy to develop it further. If not, then I may leave it as it is. To be honest, it would really be more important to add WPF support.

Phil