要让vc编写的程序支持多语言有几种方法,用xml或ini来动态load,现在介绍一种比较原始的方法,就是做一个资源dll,把resource.h和*.rc加入到一个空的dll工程中来,特别要注意的是下面:
/NOENTRY (No Entry Point)
/NOENTRY
The /NOENTRY option is required for creating a resource-only DLL.
Use this option to prevent LINK from linking a reference to _main into the DLL.
To set this linker option in the Visual Studio development environment
- Open the project's Property Pages dialog box.
- Click the Linker folder.
- Click the Advanced property page.
- Modify the Resource Only DLL property.
我给翻译一下,大意是说:要在visual studio开发环境的工程属性页的链接器选项里选择"高级"子属性页,选中仅有资源的dll属性,选择是。
也可以直接在"命令行"子属性选项里加入/NOENTRY,这样就表明没有入口点的dll,否则的话会编译不过去。