// A simple message box, with only the OK button.
AfxMessageBox(_T("Simple message box."));// A message box that uses a string from a string table
// with yes and no buttons and the stop icon.
// NOTE: nStringID is an integer that contains a valid id of
// a string in the current resource.
AfxMessageBox(nStringID, MB_YESNO|MB_ICONSTOP);
上面的代码是从msdn上查到的代码,我想问的是nStringID是个什么东西?a valid id of
a string in the current resource.这是什么意思?我要怎么获得呢?
如果使用这条代码 AfxMessageBox("Are you sure?",MB_YESNO|MB_ICONQUESTION);那么编译通过不了,所以我实在头痛- -
求哪位大侠帮帮忙啊!~

解决方案 »

  1.   

    AfxMessageBox(L"Are you sure?",MB_YESNO|MB_ICONQUESTION);
      

  2.   

    自己去看下unicode 编码    宽字节...................
      

  3.   

    是的  VS中可以选择编码方式为 多字符集 就不会有这种问题了 上边那种情况在字符串前加L
      

  4.   

    UTF8,UTF16,UNICODE,MBCB...
    各种字符集,及转换可以研究一下
      

  5.   

    你建的是Unicode工程,所以必须要用Unicode宽字符。
    AfxMessageBox(_T("Are you sure?"),MB_YESNO|MB_ICONQUESTION);
      

  6.   

    看看AfxMessageBox在MSDN中的说明吧,不只资源ID这一个解释吧。
      

  7.   

    nStringID是字符创资源的ID号,ResourceView选项卡的String table中。