實現多國語言的幾個小知識

2021-04-01 19:32:51 字數 1459 閱讀 4266

獲取模組(exe,dll)的執行目錄

cstring szcurpath(""), szmodelpath;

getmodulefilename(null,szcurpath.getbuffer(max_path),max_path); 

szcurpath.releasebuffer();

szmodelpath = szcurpath.left(szcurpath.reversefind('//') + 1); //去掉模組的名字

尋找目錄下的檔案

cfilefind find;

//call this member function to open a file search

bool bret = find.findfile(szcurpath + "*.txt");

cstring szeng = "";

while(bret)

find.close();

建立乙個目錄

createdirectory(szpath,null);

把資源檔案中的某一項寫出為檔案 

hrsrc hsrc = findresource(null,makeintresource(nid),_t("owner_data"));

if(hsrc == null) return false;

hglobal hglobal = loadresource(null,hsrc);

if(hglobal == null) return false;

lpvoid lp = lockresource(hglobal);

dword dwsize = sizeofresource(null,hsrc);

cfile file;

if(file.open(szpathname,cfile::modecreate|cfile::modewrite))

freeresource(hglobal);

配置檔案的讀寫

字串:  

getprivateprofilestring

writeprivateprofilestring

遍歷對話方塊的子控制項

cwnd* pwnd = pdlg->getwindow(gw_child);

while(pwnd != null)

獲得選單

cwnd::getmenu()

遍歷選單:

cmenu的幾個成員函式:

getsubmenu

getmenuitemcount

getmenuitemid

參考:程式實現多國語言的動態切換解決方案

實現多國語言處理

using system using system.data using system.configuration using system.web using system.web.security using system.web.ui.webcontrols using system.web....

Struts實現多國語言切換

摘要 通過下拉框裡各個語言 中文,日本語,english 的選擇,切換jsp頁面文字。tyrone1979 發表於 2005 08 26 13 27 19 1 準備資源檔案。資源檔案命名格式 filename language country.properties.中文檔名為index zh cn....

微信小程式實現多國語言的切換

實現步驟 1,首先在根目錄新建資料夾 i18n,該資料夾下是 各種語言的js檔案,如下圖所示 每個js檔案內容和下面的類似 3,在頁面中使用 首先在頁面 js檔案中引入base.js var base require base.js 然後在onshow生命週期函式中 寫入 通過單選按鈕將對應的檔名放...