|
|
|
|
Before we can make a country specific resource only file, we have to have a country specific resource for it to contain. All of the resources for all of the languages exist within a single RC file and this RC file lives in the main module’s project area. The original dialogs, string tables, etc, are copied to a country specific section of the RC file. When the country specific resource only DLL is created, it will extract its resource from this section. Dev Studio is constructed so as to make this process very easy. Select a resource. Right click and select Insert Copy….
When the Insert Resource Copy dialog appears, select a country and click OK.
In this case, we said that we were going to have English, French, German, Italian, Japanese and SPanish so repeat for all of the countries that need to be supported:
Here’s the result for the example project. Once the country specific information exists, there is still another step required. We want to move the resources out of the binary altogether. To do that, we have to add a define to the RC compilation for all configurations. Add AFX_RESOURCE_DLL to all of the main project’s configurations. When this project is built, it will not contain resources. Instead, the project will require assistance in order to find its resources. The reason that this works is because in the RC file there is a line like this: #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) for each of the language configurations. Because the main module has define AFX_RESOURCE_DLL but has not defined a target language, the resource gets skipped during compile time. So, as you can see, this is where the need for a resource DLL comes in. By a remarkable coincidence, that’s the next part of this document.
|
|
|