当多语言应用程序遇到CabWiz…… 创建安装包的方法非常简单,如果你对此没有了解,我建议你先去阅读《WM有约(五):部署应用程序》。安装包创建好后,拿到模拟器里安装,安装好后,你可以在"开始"菜单的"程序"里找到应用程序的图标: 图 1 因为我们在简体中文系统上运行应用程序,而简体中文又是应用程序支持的语言,所以应用程序会使用简体中文作为当前语言: 图 2 由于简体中文系统也支持英文,当我们在选项窗体里把当前语言改为英文时,应用程序应该能够正确显示英文界面,然而,事实并非如此! 图 3 问题究竟出在哪里?是当前语言设置出错吗?我修改代码,通过MessageBox显示当前语言,发现已被正确设为英文。当我通过Visual Studio部署到模拟器时,一切正常,而当我通过安装包部署到模拟器时,英文界面就变成上面这样了,这意味着资源文件本身应该是没问题的,但安装包里的资源文件可能出错或者损坏了。我不知道有没有第三方的安装包创建工具,如果没有的话怎么办?难道无法为多语言应用程序创建安装包? 在Windows Mobile 6 SDK文档里找到这么一段话: Files that are packaged into a .cab file to be installed on a device are stored by file name, without regard to their installation directory. For this reason, if multiple files within a .cab are given the same name but different install directories, only one of the files will be installed in all locations. To work around this behavior, be sure to use unique names for all files within a single .cab file. 这么看来,CabWiz在创建安装包的时候,误把简体中文和英文资源文件看作一样的了,因为它们的名字是一样的。怎么解决这个问题?Jose A. Garcia Guirado给出了解决方案: