用VC ++ 6显示中文

时间:2012-11-12 08:54:35

标签: c++ unicode cjk chinese-locale

  

可能重复:
  Display both of Korean and Chinese language in C++

我有一个用VC ++ 6构建的游戏的源代码。问题是当我尝试在消息框中显示中文消息时(在游戏界面中显示一个自定义消息框),中文消息总是被打破。

这是功能:

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);

这是在消息框中显示的结果:

??有足?的??入房?

1 个答案:

答案 0 :(得分:1)

您应该使用unicode API来显示中文字符,还应该将它们存储在unicode

相关问题