//多国语言的互相转换
void CMainFrame::OnTestMenu()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if(theApp.m_bIsChinese)
{
m_hInst = ::LoadLibrary("English");
AfxSetResourceHandle(m_hInst);
CMenu *pMenuCurrent = GetMenu();
m_pMenuNew = new CMenu;
if(pMenuCurrent->m_hMenu != m_hMenuDefault)
{
pMenuCurrent->DestroyMenu();
delete pMenuCurrent;
}
m_pMenuNew->LoadMenu(IDR_MAINFRAME);
SetMenu(m_pMenuNew);
theApp.m_bIsChinese = FALSE;
//MessageBox("测试成功");
}
else
{
m_hInst = ::LoadLibrary("Chinese");
AfxSetResourceHandle(m_hInst);
CMenu *pMenuCurrent = GetMenu();
m_pMenuNew = new CMenu();
if(pMenuCurrent->m_hMenu != m_hMenuDefault)
{
pMenuCurrent->DestroyMenu();
delete pMenuCurrent;
}
m_pMenuNew->LoadMenu(IDR_MAINFRAME);
SetMenu(m_pMenuNew);
theApp.m_bIsChinese = TRUE;
//MessageBox("test success");
}
}