資源簡(jiǎn)介
實(shí)現(xiàn)中英文切換,從文件中到入

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“SingleSwitch.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(IDC_RES_SWITCH?OnResSwitch)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
m_iRes=?‘a(chǎn)‘;
m_hRes=::AfxLoadLibrary(_T(“EnglishRes.dll“));
if(m_hRes)
{
::AfxSetResourceHandle(m_hRes);
m_iRes=‘E‘;
}
else
{
m_hRes=::AfxLoadLibrary(_T(“ChineseRes.dll“));
if(m_hRes)
{
?::AfxSetResourceHandle(m_hRes);
???? m_iRes=‘C‘;
}
??????
}
m_pmenu=NULL;
}
CMainframe::~CMainframe()
{
if(m_hRes)
{
::AfxFreeLibrary(m_hRes);
m_hRes=NULL;
}
if(m_pmenu)
??delete?m_pmenu;
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this?TBstyle_FLAT?WS_CHILD?|?WS_VISIBLE?|?CBRS_TOP
|?CBRS_GRIPPER?|?CBRS_TOOLTIPS?|?CBRS_FLYBY?|?CBRS_SIZE_DYNAMIC)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Delete?these?three?lines?if?you?don‘t?want?the?toolbar?to
//??be?dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
void?CMainframe::LoadMenu()
{
if(m_pmenu)
delete?m_pmenu;
m_pmenu=new?CMenu();
m_pmenu->LoadMenu(IDR_MAINframe);
::AfxGetMainWnd()->SetMenu(m_pmenu);
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2007-11-07?11:01??SingleSwitch
?????目錄??????????0??2007-10-25?13:28??SingleSwitch\ChineseRes
?????文件??????17972??2007-10-10?09:20??SingleSwitch\ChineseRes\ChineseRes.aps
?????文件???????4272??2007-10-10?10:30??SingleSwitch\ChineseRes\ChineseRes.dsp
?????文件????????543??2007-10-11?11:56??SingleSwitch\ChineseRes\ChineseRes.dsw
?????文件??????41984??2007-10-11?11:57??SingleSwitch\ChineseRes\ChineseRes.ncb
?????文件??????53760??2007-10-11?11:57??SingleSwitch\ChineseRes\ChineseRes.opt
?????文件????????764??2007-10-10?10:23??SingleSwitch\ChineseRes\ChineseRes.plg
?????目錄??????????0??2007-10-25?13:28??SingleSwitch\ChineseRes\Debug
?????文件??????99328??2007-10-10?10:23??SingleSwitch\ChineseRes\Debug\ChineseRes.pdb
?????文件??????15040??2007-10-10?10:23??SingleSwitch\ChineseRes\Debug\SingleSwitch.res
????..A.SH.????????10??2007-12-27?12:44??SingleSwitch\ChineseRes\Debug\_desktop.ini
?????目錄??????????0??2007-10-25?13:28??SingleSwitch\ChineseRes\res
?????文件???????1078??2007-10-10?09:33??SingleSwitch\ChineseRes\res\SingleSwitch.ico
?????文件????????404??2007-10-10?09:33??SingleSwitch\ChineseRes\res\SingleSwitch.rc2
?????文件???????1078??2007-10-10?09:33??SingleSwitch\ChineseRes\res\SingleSwitchDoc.ico
?????文件???????1078??2007-10-10?09:33??SingleSwitch\ChineseRes\res\Toolbar.bmp
????..A.SH.????????10??2007-12-27?12:44??SingleSwitch\ChineseRes\res\_desktop.ini
?????文件????????646??2007-10-10?09:19??SingleSwitch\ChineseRes\Resource.h
?????文件??????31304??2007-10-10?09:32??SingleSwitch\ChineseRes\SingleSwitch.aps
?????文件??????12797??2007-10-10?09:19??SingleSwitch\ChineseRes\SingleSwitch.rc
????..A.SH.????????10??2007-12-27?12:44??SingleSwitch\ChineseRes\_desktop.ini
?????目錄??????????0??2007-10-25?16:09??SingleSwitch\EnglishRes
?????目錄??????????0??2007-10-25?13:28??SingleSwitch\EnglishRes\Debug
?????文件??????99328??2007-10-10?10:24??SingleSwitch\EnglishRes\Debug\EnglishRes.pdb
?????文件??????20744??2007-10-10?10:24??SingleSwitch\EnglishRes\Debug\SingleSwitch.res
????..A.SH.????????10??2007-12-27?12:44??SingleSwitch\EnglishRes\Debug\_desktop.ini
?????文件??????17972??2007-10-10?09:21??SingleSwitch\EnglishRes\EnglishRes.aps
?????文件???????4154??2007-10-10?10:30??SingleSwitch\EnglishRes\EnglishRes.dsp
?????文件????????543??2007-10-11?11:57??SingleSwitch\EnglishRes\EnglishRes.dsw
............此處省略58個(gè)文件信息
評(píng)論
共有 條評(píng)論