0

Possible Duplicate:
Display both of Korean and Chinese language in C++

I have the source code for a game that has been built in VC++ 6. The problem is that when I try to display a Chinese message in a message box (a customized message box to display in the game interface), the Chinese message is always broken.

This is the function:

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

I call:

Message_Box("你没有足够的钱进入房间。", MB_OK);

And this is result when it displays on the message box:

??有足?的??入房?
Community
  • 1
  • 1
Bruce Vo
  • 45
  • 1
  • 8
  • You again! you never finish the question and leave... – billz Nov 12 '12 at 08:55
  • Don't know what billz means saying "you never finish the question", but anyway, having no C++11 features you should use MultiByteToWideChar() function. See the solution 4 in this thread that can help - http://www.codeproject.com/Answers/488485/Unicode-arabicpluscharacters-pluscontentplusfrompl?cmt=351401#answer4 – SChepurin Nov 12 '12 at 09:24

1 Answers1

1

You should use unicode APIs to show chinese chars, also you should store them in unicode

Matt
  • 5,747
  • 22
  • 36