here is small code that compare current date with your stored date. My date Format is YYYY-MM-DD, i Believe,you are smart Enough to modify the code according to your need.
BOOL ::FnCheckForValidDates(CString szEndDate)
{
//Get Current date
CTime TodayDate=CTime::GetCurrentTime();
int nYear,nMonth,nDay;
//date format YYYY-MM-DD
///Extract Year
nYear=\_ttoi(szEndDate.Left(szEndDate.Find('-')));
///remove the Year from String
szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
///Replace Extra '-'
szEndDate.TrimLeft('-');
///Extract Month
nMonth=_ttoi(szEndDate.Left(szEndDate.Find('-')));
///remove the Year from String
szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
///Replace Extra '-'
szEndDate.TrimLeft('-');
///Extract Day
nDay=\_ttoi(szEndDate);
///comparison Routine
///first Check year
if(TodayDate.GetYear()>nYear)
return FALSE;
if(TodayDate.GetMonth()>nMonth)
return FALSE;
if(TodayDate.GetDay()>nDay)
return FALSE;
#ifdef MYDEBUG
AfxMessageBox("Returning True");
#endif
return TRUE;
}
[Vote One Here, Complete my Survey....] Alok Gupta
visit me at http://www.thisisalok.tk "I Think Believe this Will Help"