CString strNumber;
strNumber.Format("%0.2f",tim.getTimeMilli());
SetDlgItemText(IDC_TIME_USED,strNumber);

 error C2664: 'voidATL::CStringT::Format(const wchar_t *,...)' : cannot convertparameter 1 from 'const char [6]' to 'const wchar_t *'
 with
1>         [
1>            BaseType=wchar_t,
1>            StringTraits=StrTraitMFC_DLL
1>         ]
1>         Types pointed to areunrelated; conversion requires reinterpret_cast, C-style cast orfunction-style cast

解决方法:
采用了UNICODE编码, 
可以用 
a.Format(L "%d ",  b); 
或者 
a.Format(_T( "%d "),   b);
即:strNumber.Format(_T("%.2f "), tim.getTimeMilli());
OK!

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-06-19
  • 2022-12-23
  • 2021-12-08
  • 2022-02-13
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
相关资源
相似解决方案