0
可能重複:
Display both of Korean and Chinese language in C++顯示中國在VC++ 6
我有已建成的VC++ 6.0的問題是一個遊戲的源代碼,當我嘗試在消息框(在遊戲界面中顯示的定製消息框)中顯示中文消息,中文消息總是被打破。
這是函數:
BOOL Message_Box(char * msg, int Button, void (*pProcOK)(), void (*pProcCancel)()){
CMsgDlg dlg;
int nCnt = 100;
int nIndex = 0;
do {
nIndex = FindMsgDlg(nCnt);
if(nIndex == -1)
break;
nCnt++;
} while(true);
dlg.SetDlg(g_hMainWnd, nCnt, Button, msg, pProcOK, pProcCancel);
g_vtDlgList.push_back(nCnt);
g_vtMsgBox.push_back(dlg);
ShowDlg(dlg.GetIndex());
return FALSE;
}
我打電話:
Message_Box("你沒有足夠的錢進入房間。", MB_OK);
這是結果,當它顯示在消息框:
??有足?的??入房?
你又來了!你永遠不會完成這個問題,並離開... – billz
不知道什麼Billz意味着說「你永遠不會完成問題」,但無論如何,沒有C++ 11功能,你應該使用MultiByteToWideChar()函數。請參閱此線程中的解決方案4,可以提供幫助 - http://www.codeproject.com/Answers/488485/Unicode-arabicpluscharacters-pluscontentplusfrompl?cmt=351401#answer4 – SChepurin