Hi All,
Please see the attachement.
What is the API for getting the range of year value.
It seems GetLocaleInfo doesn not return that.
Thanks in advance
Printable View
Hi All,
Please see the attachement.
What is the API for getting the range of year value.
It seems GetLocaleInfo doesn not return that.
Thanks in advance
Use GetCalendarInfo
Please find the code snippet for finding MaxYear using GetCalendarInfo
void CSampleDlg::GetMaximumYear()
{
CString csMaxYear;
TCHAR tcBuffer[256];
int nSize = GetCalendarInfo( LOCALE_SYSTEM_DEFAULT,
CAL_GREGORIAN_US,
CAL_ITWODIGITYEARMAX,
tcBuffer,
0,
0 );
LPTSTR lpDateFmt = csMaxYear.GetBuffer( nSize );
nSize = GetCalendarInfo( LOCALE_SYSTEM_DEFAULT,
CAL_GREGORIAN_US,
CAL_ITWODIGITYEARMAX,
lpDateFmt,
nSize,
0 );
csMaxYear = lpDateFmt;
}