资源简介

MFC 多语言环境的实现,VS2015的工程,如果有疑问可见博客文章 http://blog.csdn.net/weixinhum/article/details/51202263

资源截图

代码片段和文件信息

#define CHINESE 0
#define ENGLISH 1
void CMFCMultiLanguageDemoDlg::LanguageChange(int nLanguage)
{
switch (nLanguage)
{
case CHINESE:
mylanguage.SelectLanguage=loadlanguagefile(“CHINESE.mo“);//读取语言包文件
break;
case ENGLISH:
mylanguage.SelectLanguage=loadlanguagefile(“ENGLISH.mo“);//读取语言包文件
break;
}
//根据语言包翻译控件字符,Translation函数返回翻译完的字符给控件
CMenu* pSubMenu;
CMenu* pMenu = GetMenu();
//菜单字符修改
pMenu->ModifyMenu(0 MF_BYPOSITION 0 mylanguage.Translation(L“文件(F)“));
pSubMenu = pMenu->GetSubMenu(0);
pSubMenu->ModifyMenu(ID_NEWFILE MF_BYCOMMAND ID_NEWFILE mylanguage.Translation(L“新建(N)“));
pMenu->ModifyMenu(1 MF_BYPOSITION 0 mylanguage.Translation(“编辑(E)“));
pSubMenu = pMenu->GetSubMenu(1);
pSubMenu->ModifyMenu(ID_EDIT MF_BYCOMMAND ID_EDIT mylanguage.Translation(L“撤销(U)“));
DrawMenuBar();
//按钮字符修改
GetDlgItem(IDC_BUTTON_CHINESE)->SetWindowTextW(mylanguage.Translation(L“中文“));
GetDlgItem(IDC_BUTTON_ENGLISH)->SetWindowTextW(mylanguage.Translation(L“英文“));

}
void CMFCMultiLanguageDemoDlg::OnBnClickedButtonChinese()
{
LanguageChange(CHINESE);
}
void CMFCMultiLanguageDemoDlg::OnBnClickedButtonEnglish()
{
LanguageChange(ENGLISH);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-04-20 20:48  MFCMultiLanguageDemo\
     目录           0  2016-04-20 16:05  MFCMultiLanguageDemo\.vs\
     目录           0  2016-04-20 16:05  MFCMultiLanguageDemo\.vs\MFCMultiLanguageDemo\
     目录           0  2016-04-20 16:05  MFCMultiLanguageDemo\.vs\MFCMultiLanguageDemo\v14\
     文件       35840  2016-04-20 20:48  MFCMultiLanguageDemo\.vs\MFCMultiLanguageDemo\v14\.suo
     目录           0  2016-04-20 18:57  MFCMultiLanguageDemo\Debug\
     文件      212992  2016-04-20 20:37  MFCMultiLanguageDemo\Debug\MFCMultiLanguageDemo.exe
     文件     1353620  2016-04-20 20:37  MFCMultiLanguageDemo\Debug\MFCMultiLanguageDemo.ilk
     文件     2822144  2016-04-20 20:37  MFCMultiLanguageDemo\Debug\MFCMultiLanguageDemo.pdb
     目录           0  2016-04-20 20:49  MFCMultiLanguageDemo\ipch\
     目录           0  2016-04-20 20:48  MFCMultiLanguageDemo\MFCMultiLanguageDemo\
     文件        1342  2016-04-20 16:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo.sln
     文件        1273  2016-04-20 17:29  MFCMultiLanguageDemo\MFCMultiLanguageDemo\code.cpp
     目录           0  2016-04-20 20:48  MFCMultiLanguageDemo\MFCMultiLanguageDemo\Debug\
     文件         934  2016-04-20 20:34  MFCMultiLanguageDemo\MFCMultiLanguageDemo\en.po
     文件       60928  2011-05-23 16:45  MFCMultiLanguageDemo\MFCMultiLanguageDemo\LanguageLib.dll
     文件        2398  2011-05-23 14:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo\LanguageLib.lib
     目录           0  2016-04-20 20:36  MFCMultiLanguageDemo\MFCMultiLanguageDemo\Languages\
     文件         723  2016-04-20 20:34  MFCMultiLanguageDemo\MFCMultiLanguageDemo\Languages\en.mo
     文件         723  2016-04-20 20:32  MFCMultiLanguageDemo\MFCMultiLanguageDemo\Languages\zhcn.mo
     文件       92092  2016-04-20 20:35  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.aps
     文件        2552  2016-04-20 16:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.cpp
     文件         527  2016-04-20 16:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.h
     文件       11728  2016-04-20 16:26  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.rc
     文件       10785  2016-04-20 18:57  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.vcxproj
     文件        2236  2016-04-20 18:10  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemo.vcxproj.filters
     文件        4305  2016-04-20 19:51  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemoDlg.cpp
     文件        1471  2016-04-20 20:11  MFCMultiLanguageDemo\MFCMultiLanguageDemo\MFCMultiLanguageDemoDlg.h
     文件        4283  2016-04-20 16:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo\ReadMe.txt
     目录           0  2016-04-20 16:05  MFCMultiLanguageDemo\MFCMultiLanguageDemo\res\
     文件        2002  2016-04-20 16:39  MFCMultiLanguageDemo\MFCMultiLanguageDemo\resource.h
............此处省略7个文件信息

评论

共有 条评论