Another solution to hold and compare the dates :) :
typedef struct sMydate {
WORD m_wYear;
BYTE m_byMonth;
BYTE m_byDay;
sMydate(WORD wYear, BYTE byMonth, BYTE byDay) {
m_wYear = wYear;
m_byMonth = byMonth;
m_byDay = byDay;
}
int Compare(const sMydate& sAnotherDate) {
LONG lThisDate = MAKELONG(MAKEWORD(m_byDay, m_byMonth), m_wYear);
LONG lAnotherDate = MAKELONG(MAKEWORD(sAnotherDate.m_byDay,
sAnotherDate.m_byMonth),
sAnotherDate.m_wYear);
return memcmp(&lThisDate, &lAnotherDate, sizeof(LONG));
}
} MYDATE, *LPMYDATE;
...
const MYDATE sConstDate(1900, 12, 29);
...
{
...
MYDATE sLocalDate(2010, 04, 06);
int iResult = sLocalDate.Compare(sConstDate);
...
}
;