I've used the Cstring format to convernt a CTime into a a CString, yet I get an error message, here's the code:
void CTimerDlg::OnTi mer(UINT_PTR nIDEvent)
{
CString m_sTime;
// TODO: Add your message handler code here and/or call default
CTime CurTime = CTime::GetCurre ntTime();
m_sTime.Format ("%d,%d,%d", CurTime.GetHour (), CurTime.GetMinu te(),CurTime.Ge tSecond());
UpdateData(FALS E);
CDialog::OnTime r(nIDEvent);
}
The Error message is : error C2664: 'void ATL::CStringT<B aseType,StringT raits>::Format( const wchar_t *,...)' : cannot convert parameter 1 from 'const char [9]' to 'const wchar_t *'
How do I do this?
void CTimerDlg::OnTi mer(UINT_PTR nIDEvent)
{
CString m_sTime;
// TODO: Add your message handler code here and/or call default
CTime CurTime = CTime::GetCurre ntTime();
m_sTime.Format ("%d,%d,%d", CurTime.GetHour (), CurTime.GetMinu te(),CurTime.Ge tSecond());
UpdateData(FALS E);
CDialog::OnTime r(nIDEvent);
}
The Error message is : error C2664: 'void ATL::CStringT<B aseType,StringT raits>::Format( const wchar_t *,...)' : cannot convert parameter 1 from 'const char [9]' to 'const wchar_t *'
How do I do this?
Comment