| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> zen yang zai cheng xu zhong li yong C++ zhi chi duo guo yu yan

zen yang zai cheng xu zhong li yong C++ zhi chi duo guo yu yan

2008-06-01 02:05:39 编辑來源:互联网 评论
 
 
 
本文为【怎样在程序中利用C++支持多国语言】的拼音翻译版
  ben wen yi eMule wei li , tan tao yi xia duo guo yu yan zhi chi de shi xian 。 xuan ze emule, yin wei ta de duo guo yu yan zhi chi shi xian de xiang dang hao , ke yi zhi chi dong tai qie huan 。 er qie zui yao hai , ta shi kai yuan de , ke yi zhi jie tong guo yuan ma lai yan jiu ta de shi xian ji shu 。
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  emule shi li yong dong tai jia zai zi yuan DLL lai shi xian duo yu yan qie huan de , mei yi ge zi yuan DLL zhong bao han le yi fen dui ying mou yi yu yan de zi fu chuan biao 。 zai yuan ma de srchybrid\lang lu jing shang ke yi fa xian yi ge lang jie jue fang an , qi zhong bao han le cha bu duo 40 ge xiang mu , mei ge xiang mu bian yi chu lai dou shi yi ge dan du de DLL。 zhe xie DLL zai cheng xu an zhuang shi kao bei dao zhi ding de mu lu zhong 。 mei ge DLL li mian dou shi yi ge da de string table。emule wei mei yi ge yong dao de zi fu chuan ( da yue wei 1400 duo ge ) dou zhi ding le yi ge gu ding ID, zai bu tong de DLL zhong zhe ge ID dui ying le zhe ge zi fu chuan de bu tong yu yan de fan yi ban ben 。 zhe yang mei dang xu yao zhe ge zi chuan shi jiu tong guo ID qu huo qu , zai dang shi cheng xu jia zai de mou yi te ding yu yan de DLL, jiu ke yi qu dao xiang ying yu yan de zi chuan 。
  ying wen ban ben de string table bian yi zai zhu EXE wen jian zhong , zhe yang dang mou yi yu yan bu zhi chi , huo DLL wen jian jia zai shi bai shi huan ke yi shi yong ying yu ban ben 。
  xia mian wo men jiu kan kan ju ti de shi xian 。
  zhu yao shi xian dai ma zai I18n.cpp wen jian zhong 。 ru kou han shu shi void CPReferences::SetLanguage(), zhe ge han shu zai zai void CPreferences::LoadPreferences() han shu zhong bei tiao yong , ji zai ru le cheng xu de ge zhong xuan xiang hou 。 dang cheng xu di yi ci yun xing shi , zai xuan xiang wen jian ( ji preferences.ini) zhong mei you nei rong ,SetLanguage han shu hui gen ju xi tong de ben di yu yan she zhi lai jia zai dui ying de yu yan DLL zi yuan , suo yi wo men di yi ci an zhuang hou jiu shi zhong wen , wu xu she zhi 。 zhe yi dian wo men hou mian hui shuo dao 。
  ling wai zai BOOL CPPgGeneral::OnApply() zhong ye tiao yong le gai han shu , ji yong hu zai “ xuan xiang ” chuang kou zhong gai bian le yu yan xuan ze hou 。
  zai void CPreferences::SetLanguage() han shu zhong , shou xian tiao yong le static void InitLanguages(const CString& rstrLangDir, bool bReInit = false) han shu 。 zhe ge han shu zhu yao shi tong guo bian li “ yu yan ” mu lu ( ji wo men qian mian shuo di de , zhuan men yong yu cun fang ge zhong yu yan ban ben DLL de mu lu ), lai chu shi hua jing tai “ yu yan biao ” (_aLanguages), zhe shi ge jing tai shu zu , qi zhong de mei yi xiang dui ying yi zhong zhi chi de yu yan 。 fan neng zhao dao xiang ying DLL wen jian de , jiu zai biao zhong biao ji gai yu yan wei zhi chi 。
  ran hou tiao yong static bool LoadLangLib(const CString& rstrLangDir, LANGID lid) lai zai ru xiang ying de yu yan DLL。 zhe ge han shu bi jiao jian dan , tong guo cha “ yu yan biao ”(_aLanguages), jia ru yao zai ru de yu yan shi zhi chi de , jiu jia zai xiang ying de DLL wen jian , bing jiang DLL mo kuai ju bing cun dao _hLangDLL zhong , zhe ye shi yi ge jing tai bian liang 。 wo men ke yi kan dao jia ru shi ying yu , shi bu xu yao jia zai de , zhi jie yong EXE mo kuai zhong de zi yuan zi fu chuan biao 。
  jia ru tiao yong LoadLangLib wen jian jia zai zhi ding de yu yan shi bai , cheng xu hui chang shi pan ding ben di xi tong de yu yan ji , bing jia zai dui ying de yu yan , jia ru jia zai ye shi bai jiu shi yong ying yu 。
  yu yan wen jian jia zai cheng gong hou , cheng xu hui chang shi cong zhong jia zai yi ge zi chuan , jia ru shi bai , shuo ming ke neng DLL wen jian sun huai , ze zai chong she yu yan wei ying yu 。 ying yu zi chuan shi nei zhi zai EXE wen jian zhong de , suo yi shi zui ke kao de 。
  zhi ci , jia zai cheng gong , ju bing bao cun zai _hLangDLL jing tai bian liang zhong 。
  zui hou zai xu yao zi fu chuan de di fang cheng xu tong guo CString GetResString(UINT uStringID, Word wLanguageID) huo CString GetResString(UINT uStringID) han shu jia zai xiang ying de zi fu chuan 。 zhe ge han shu de gong neng hen jian dan , jiu shi cong _hLangDLL zhi ding de mo kuai zhong jia zai zi fu chuan zi yuan 。 jia ru _hLangDLL wei NULL jiu shi cong dang qian mo kuai jia zai , wo men qian mian yi jing kan dao le , jia ru shi yong ying yu zhe ge bian liang de zhi jiu shi NULL。
  zai emule de yuan ma zhong , ji hu mei ge dui hua kuang dou shi xian le yi ge Localize(void) han shu , zhe ge han shu jiu shi tong guo tiao yong GetResString lai she zhi dui hua kuang shang suo you kong jian de wen zi 。 zai BOOL CPPgGeneral::OnApply() han shu zhong wo men ke yi kan dao , zai tiao yong CPreferences::SetLanguage han shu qie huan le yu yan hou , hui yi ci tiao yong dui hua kuang he chuang kou de Localize(void) han shu , chong xin she zhi UI de wen zi nei rong 。
  zui hou zhu chong yi dian , jia ru ni xiang rang ying yong zhi chi duo yu yan , zai she ji dui hua kuang shi yao ba dui hua kuang de Language shu xing she wei “ fei te ding yu yan ”。 zai “ zi yuan ” shi tu zhong xuan zhong xiang ying de dui hua kuang jie dian , zai qie huan dao “ shu xing ” shi tu jiu ke yi kan dao zhe ge xuan xiang le 。 jia ru bu she zhi hui chu xian luan ma 。
怎样在程序中利用C++支持多国语言
geng duo nei rong qing kan C/C++ jin jie ji shu wen dang zhuan ti , huo【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
   ben wen yi eMule wei li , tan tao yi xia duo guo yu yan zhi chi de shi xian 。 xuan ze emule, yin wei ta de duo guo yu yan zhi chi shi xian de xiang dang hao , ke yi zhi chi dong tai qie huan 。 er qie zui yao hai , ta shi kai yuan de , ke yi zhi jie tong guo yuan ma lai yan jiu ta de shi xian ji shu 。   emule shi li yong dong tai jia zai zi yuan DLL lai shi xian duo yu yan qie huan de , mei yi ge zi yuan DLL zhong bao han le yi fen dui ying mou yi yu yan de zi fu chuan biao 。 zai yuan ma de srchybrid\lang lu jing shang ke yi fa xian yi ge lang jie jue fang an , qi zhong bao han le cha bu duo 40 ge xiang mu , mei ge xiang mu bian yi chu lai dou shi yi ge dan du de DLL。 zhe xie DLL zai cheng xu an zhuang shi kao bei dao zhi ding de mu lu zhong 。 mei ge DLL li mian dou shi yi ge da de string table。emule wei mei yi ge yong dao de zi fu chuan ( da yue wei 1400 duo ge ) dou zhi ding le yi ge gu ding ID, zai bu tong de DLL zhong zhe ge ID dui ying le zhe ge zi fu chuan de bu tong yu yan de fan yi ban ben 。 zhe yang mei dang xu yao zhe ge zi chuan shi jiu tong guo ID qu huo qu , zai dang shi cheng xu jia zai de mou yi te ding yu yan de DLL, jiu ke yi qu dao xiang ying yu yan de zi chuan 。    ying wen ban ben de string table bian yi zai zhu EXE wen jian zhong , zhe yang dang mou yi yu yan bu zhi chi , huo DLL wen jian jia zai shi bai shi huan ke yi shi yong ying yu ban ben 。    xia mian wo men jiu kan kan ju ti de shi xian 。    zhu yao shi xian dai ma zai I18n.cpp wen jian zhong 。 ru kou han shu shi  void CPReferences::SetLanguage() , zhe ge han shu zai zai  void CPreferences::LoadPreferences()  han shu zhong bei tiao yong , ji zai ru le cheng xu de ge zhong xuan xiang hou 。 dang cheng xu di yi ci yun xing shi , zai xuan xiang wen jian ( ji preferences.ini) zhong mei you nei rong ,SetLanguage han shu hui gen ju xi tong de ben di yu yan she zhi lai jia zai dui ying de yu yan DLL zi yuan , suo yi wo men di yi ci an zhuang hou jiu shi zhong wen , wu xu she zhi 。 zhe yi dian wo men hou mian hui shuo dao 。    ling wai zai  BOOL CPPgGeneral::OnApply()  zhong ye tiao yong le gai han shu , ji yong hu zai “ xuan xiang ” chuang kou zhong gai bian le yu yan xuan ze hou 。    zai  void CPreferences::SetLanguage()  han shu zhong , shou xian tiao yong le  static void InitLanguages(const CString& rstrLangDir, bool bReInit = false)  han shu 。 zhe ge han shu zhu yao shi tong guo bian li “ yu yan ” mu lu ( ji wo men qian mian shuo di de , zhuan men yong yu cun fang ge zhong yu yan ban ben DLL de mu lu ), lai chu shi hua jing tai “ yu yan biao ” (_aLanguages), zhe shi ge jing tai shu zu , qi zhong de mei yi xiang dui ying yi zhong zhi chi de yu yan 。 fan neng zhao dao xiang ying DLL wen jian de , jiu zai biao zhong biao ji gai yu yan wei zhi chi 。    ran hou tiao yong  static bool LoadLangLib(const CString& rstrLangDir, LANGID lid)  lai zai ru xiang ying de yu yan DLL。 zhe ge han shu bi jiao jian dan , tong guo cha “ yu yan biao ”(_aLanguages), jia ru yao zai ru de yu yan shi zhi chi de , jiu jia zai xiang ying de DLL wen jian , bing jiang DLL mo kuai ju bing cun dao _hLangDLL zhong , zhe ye shi yi ge jing tai bian liang 。 wo men ke yi kan dao jia ru shi ying yu , shi bu xu yao jia zai de , zhi jie yong EXE mo kuai zhong de zi yuan zi fu chuan biao 。    jia ru tiao yong LoadLangLib wen jian jia zai zhi ding de yu yan shi bai , cheng xu hui chang shi pan ding ben di xi tong de yu yan ji , bing jia zai dui ying de yu yan , jia ru jia zai ye shi bai jiu shi yong ying yu 。    yu yan wen jian jia zai cheng gong hou , cheng xu hui chang shi cong zhong jia zai yi ge zi chuan , jia ru shi bai , shuo ming ke neng DLL wen jian sun huai , ze zai chong she yu yan wei ying yu 。 ying yu zi chuan shi nei zhi zai EXE wen jian zhong de , suo yi shi zui ke kao de 。    zhi ci , jia zai cheng gong , ju bing bao cun zai _hLangDLL jing tai bian liang zhong 。    zui hou zai xu yao zi fu chuan de di fang cheng xu tong guo  CString GetResString(UINT uStringID, Word wLanguageID)  huo  CString GetResString(UINT uStringID)  han shu jia zai xiang ying de zi fu chuan 。 zhe ge han shu de gong neng hen jian dan , jiu shi cong _hLangDLL zhi ding de mo kuai zhong jia zai zi fu chuan zi yuan 。 jia ru _hLangDLL wei NULL jiu shi cong dang qian mo kuai jia zai , wo men qian mian yi jing kan dao le , jia ru shi yong ying yu zhe ge bian liang de zhi jiu shi NULL。    zai emule de yuan ma zhong , ji hu mei ge dui hua kuang dou shi xian le yi ge Localize(void) han shu , zhe ge han shu jiu shi tong guo tiao yong GetResString lai she zhi dui hua kuang shang suo you kong jian de wen zi 。 zai   BOOL CPPgGeneral::OnApply()  han shu zhong wo men ke yi kan dao , zai tiao yong CPreferences::SetLanguage han shu qie huan le yu yan hou , hui yi ci tiao yong dui hua kuang he chuang kou de Localize(void) han shu , chong xin she zhi UI de wen zi nei rong 。    zui hou zhu chong yi dian , jia ru ni xiang rang ying yong zhi chi duo yu yan , zai she ji dui hua kuang shi yao ba dui hua kuang de Language shu xing she wei “ fei te ding yu yan ”。 zai “ zi yuan ” shi tu zhong xuan zhong xiang ying de dui hua kuang jie dian , zai qie huan dao “ shu xing ” shi tu jiu ke yi kan dao zhe ge xuan xiang le 。 jia ru bu she zhi hui chu xian luan ma 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785355.html][img]http://image.wangchao.net.cn/it/1323423780048.gif[/img][/url] geng duo nei rong qing kan C/C++ jin jie ji shu wen dang zhuan ti , huo
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
玉美人_珠联璧合
清纯美女米卡
清新靓丽的早晨
玲子的自信与性感
痞子的甘南日记
疑是银河落九天
雪域坝上四——纯美色
冬日恋歌——西城杨柳弄轻柔
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有