How to Get the Date Value from CMonthCalCtrl and CDateTimeCtrl ?
-
Hi there All, I'm trying to Retrive the Date in form of COleDateTime from a CMonthCalCtrl and CDateTimeCtrl but not very succesfull at this. I'm trying to Use the BOOL GetCurSel( COleDateTime& refDateTime ) const; function but then i get an invalid Date - i tried to catch different Messages of the Above Controls and none of them do the Job. Can somone please Help me, Just a short Code example to see how its done will be more than enough. Thanks in advance, Ariel.
-
Hi there All, I'm trying to Retrive the Date in form of COleDateTime from a CMonthCalCtrl and CDateTimeCtrl but not very succesfull at this. I'm trying to Use the BOOL GetCurSel( COleDateTime& refDateTime ) const; function but then i get an invalid Date - i tried to catch different Messages of the Above Controls and none of them do the Job. Can somone please Help me, Just a short Code example to see how its done will be more than enough. Thanks in advance, Ariel.
GetCurSel uses MCM_GETCURSEL which doesn't fill in the time members in the SYSTEMTIME stucture. SYSTEMTIME tSysTime; m_uiCalendar.GetCurSel(&tSysTime); tSysTime.wHour = 0; tSysTime.wMinute = 0; tSysTime.wSecond = 0; tSysTime.wMilliseconds = 0; COleDateTime dtDate(tSysTime); Step through the code or search for _AfxOleDateFromTm in the source to see where the COleDateTime is set to invalid.