DATETIMEPICKER
-
There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?
-
There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?
If dd.mm.yyyy was the date format in your regional settings, you could just do this:
m_Date = COleDateTime(m_sBD);
UpdateData(FALSE);If not, you need to parse the string yourself:
int year, month, day;
_tscanf((LPCTSTR)m_sBD, "%d.%d.%d", &day, &month, &year);
m_Date = COleDateTime(year, month, day);
UpdateData(FALSE);Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?
I didn't know that you could associate a COleDateTime variable with a CDateTimePicker but after testing it, it seems possible. So, what you will need to do is set the new date in your m_date object and then update your dialog to show the changes. The first step can be done by calling COleDateTime::ParseDateTime[^] The second step can be done by calling
UpdateData(FALSE)
in your dialog class.Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++