History: MfcSatelliteDlls

Preview of version: 1

I only recently learned, that MFC version 7.0 and later have support for satellite DLLs. After a little investigation, I found that this mechanism works fundamentally better than having resources for multiple languages compiled into the main application.

The problem with compiling multiple languages into an MFC application, is that there is no easy way to switch between languages. Originally, this was possible with the Win32 function SetThreadLocale, but Microsoft broke this functionality (presumably by design) as long ago as Windows 2000. Loading language specific dialog and menu-resources requires additional code in each affected component.

If you compile language resources into a separate DLL, all you have to do is load the DLL with LoadLibrary() and then call AfxSetResourceHandle() with the module handle (HMODULE) of the DLL. Providing all resources are present in the DLL, this seems to work perfectly.

In Version 4.7x.0028 of the Add-In, there is now build in support for MFC satellite DLLs. I will try to explain the details in this article.

Selecting MFC satellite DLL support

You can select support for MFC satellite DLLs via the project properties dialog:
Image
Image
Image

History

Information Version
Sat 05 of Feb, 2011 16:39 GMT Phil 14
Sat 17 of Jul, 2010 13:20 GMT Phil 13
Fri 16 of Jul, 2010 22:11 GMT Phil 12
Fri 16 of Jul, 2010 22:05 GMT Phil 11
Fri 16 of Jul, 2010 21:43 GMT Phil 10
Fri 16 of Jul, 2010 21:29 GMT Phil 9
Fri 16 of Jul, 2010 21:09 GMT Phil 8
Fri 16 of Jul, 2010 20:54 GMT Phil 7
Fri 16 of Jul, 2010 20:30 GMT Phil 6
Fri 16 of Jul, 2010 20:13 GMT Phil 5
Fri 16 of Jul, 2010 20:09 GMT Phil 4
Fri 16 of Jul, 2010 20:08 GMT Phil 3
Fri 16 of Jul, 2010 20:05 GMT Phil 2
Thu 15 of Jul, 2010 22:54 GMT Phil 1