convert short to Cstring...
-
Hi, short m_start_year; COleDateTime tm = COleDateTime::GetCurrentTime(); m_start_year = (short) tm.GetYear(); I need to convert this m_start_year to CString to pass a argument for below function. CString result_startdate = GetShowYear(m_start_year); CString GetShowYear(CString m_start_year) { // Here i will do the Inline query and get the show start date. } In the above code how to cast short to CString as the GetShowYear need to pass only CString value but from tm.GetYear() i am getting as "short" value. Any idea? Reg, SPa
-
Hi, short m_start_year; COleDateTime tm = COleDateTime::GetCurrentTime(); m_start_year = (short) tm.GetYear(); I need to convert this m_start_year to CString to pass a argument for below function. CString result_startdate = GetShowYear(m_start_year); CString GetShowYear(CString m_start_year) { // Here i will do the Inline query and get the show start date. } In the above code how to cast short to CString as the GetShowYear need to pass only CString value but from tm.GetYear() i am getting as "short" value. Any idea? Reg, SPa
Use CString::Format funcion to convert short to string like this.
CString strYear;
strYear.Format("%d", m_start_year); -
Hi, short m_start_year; COleDateTime tm = COleDateTime::GetCurrentTime(); m_start_year = (short) tm.GetYear(); I need to convert this m_start_year to CString to pass a argument for below function. CString result_startdate = GetShowYear(m_start_year); CString GetShowYear(CString m_start_year) { // Here i will do the Inline query and get the show start date. } In the above code how to cast short to CString as the GetShowYear need to pass only CString value but from tm.GetYear() i am getting as "short" value. Any idea? Reg, SPa
-
Use CString::Format funcion to convert short to string like this.
CString strYear;
strYear.Format("%d", m_start_year);Simple yet very effective. :thumbsup:
-
Hi, short m_start_year; COleDateTime tm = COleDateTime::GetCurrentTime(); m_start_year = (short) tm.GetYear(); I need to convert this m_start_year to CString to pass a argument for below function. CString result_startdate = GetShowYear(m_start_year); CString GetShowYear(CString m_start_year) { // Here i will do the Inline query and get the show start date. } In the above code how to cast short to CString as the GetShowYear need to pass only CString value but from tm.GetYear() i am getting as "short" value. Any idea? Reg, SPa