报错为:
 error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [3]' to 'const wchar_t *'
1>        with
1>        [
1>            BaseType=wchar_t,
1>            StringTraits=StrTraitMFC_DLL<wchar_t>
1>        ]
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast不知道这是怎么回事,请指教解决方法。

解决方案 »

  1.   

    补充一下:
    我在使用的时候,是这样的:
    CString m_Info;
    m_Info[i].Format("%d",ucInfo);
    改成:
    CString m_Info;
    m_Info[i].Format((wchar_t *)"%d",ucInfo);
    可以编译通过,
    但是界面中显示的却是乱码,
    所以,我想确认一下,
    如何彻底解决这个问题??
    ATL和MFC的编码有什么不同吗?
      

  2.   

    你选的是unicode吧,定义不统一,unicode中使用的都是wchar_t
      

  3.   

    像这个问题中所报的:
    1>            BaseType=wchar_t, 
    1>            StringTraits=StrTraitMFC_DLL <wchar_t> 有办法改变吗?
    如何执行呢?请指点
      

  4.   

    改一下编译选项么,注意,vc6默认的不是Unicode,而VC7和vc8默认的都是UNICODE。
      

  5.   

    m_Info[i].Format(_T("%d"),ucInfo);