CString str;
 str.Format("Great game! You have $ %.2f left.", m_Amt_Remaining);),


上VC6中上述代码没有问题,但在Visual stdio 2008中编译中有错误:

错误提示:
error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [10]”转换为“const wchar_t *”

VS2008默认是UNICODE环境
所以把你所有字符串相关的操作都用_T() TEXT() 包含起来


 str.Format(_T("Amount Remaining $ %.2f",m_Amt_Remaining));

相关文章:

  • 2021-12-08
  • 2021-09-03
  • 2022-12-23
  • 2022-02-10
  • 2021-07-25
  • 2022-01-17
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2022-01-27
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-12-17
相关资源
相似解决方案