眉標=LanguageSupport類別 副標=語系資源動態函式庫 大標=製作支援多國語系軟體介面 作者=文/林學文 ==========程式========== theApp.m_LanguageSupport.OnSwitchLanguage(nId); ==========程式========== ==========程式========== 程式1 // 載入新的選單資源 m_NewMenu.DestroyMenu(); m_NewMenu.LoadMenu(IDR_MAINFRAME); ASSERT(m_NewMenu); // 移除舊的選單 SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); // 指定新的選單 SetMenu(&m_NewMenu); // 記錄預設選單Handle m_hMenuDefault = m_NewMenu.GetSafeHmenu(); ==========程式========== ==========程式========== ResText extract ==========程式========== ==========程式========== ResText apply <原始DLL範本名稱> <要產生的DLL名稱> [langID] ==========程式========== ==========程式========== 列表1 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 1900-01-01 00:00+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: MenuEntry msgid "&About MyMainProgram..." msgstr "" #: MenuEntry msgid "&Copy\tCtrl+C" msgstr "" ==========程式========== ==========程式========== 列表2 #: MenuEntry msgid "&About MyMainProgram..." msgstr "[&A]關於 MyMainProgram…" #: MenuEntry msgid "&Copy\tCtrl+C" msgstr "[&C]複製\tCtrl+C" ==========程式========== ==========程式========== ResText extract MyAppLanguageDll.dll MyApp.pot ==========程式========== ==========程式========== ResText apply MyAppLanguageDll.dll MyApp1028.dll MyApp_CHI.po ==========程式========== ==========程式========== LANGID GetLangIdFromFile (LPCTSTR pszFilename, LPCTSTR pszAppname ); bool LoadLanguageDll(); ==========程式==========