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.
|
You can select support for MFC satellite DLLs for the current project using the project properties dialog, shown here on the right You can set the default for new projects using the Add-in settings dialog, shown below. |
|
|
You can access these two dialogs using the toolbar buttons indicated here. |
|
If you have selected satellite DLL Support, then the Add-In will generate