Export (0) Print
Expand All

EnumCalendarInfo (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function enumerates the calendar information by calling an application-defined callback function. It passes the callback function a pointer to a string buffer that contains the requested calendar information. This continues until either the last applicable calendar is found or the callback function returns FALSE.

BOOL EnumCalendarInfo(
  CALINFO_ENUMPROC lpCalInfoEnumProc, 
  LCID Locale, 
  CALID Calendar, 
  CALTYPE CalType
); 

Parameters

lpCalInfoEnumProc
[in] Pointer to an application-defined callback function. For more information, see the EnumCalendarInfoProc callback function.
Locale
[in] Value that specifies the locale to retrieve calendar information for. This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values. The following table shows the values this parameter can take.
ValueDescription
LOCALE_SYSTEM_DEFAULTDefault system locale.
LOCALE_USER_DEFAULTDefault user locale.
LOCALE_NEUTRALDefault language-neutral locale.
Calendar
[in] Value that specifies the calendar for which information is requested. The following table shows the values this parameter can take.
ValueDescription
ENUM_ALL_CALENDARSEnumerate all applicable calendars for the locale specified by Locale.
CAL_GREGORIANGregorian (localized)
CAL_GREGORIAN_USGregorian (English strings always)
CAL_JAPANJapanese Emperor Era
CAL_TAIWANTaiwan Calendar
CAL_KOREAKorean Tangun Era
CAL_HIJRIHijri (Arabic Lunar)
CAL_THAIThai
CAL_HEBREWHebrew
CAL_GREGORIAN_ME_FRENCHGregorian Middle East French
CAL_GREGORIAN_ARABICGregorian Arabic
CAL_GREGORIAN_XLIT_ENGLISHGregorian transliterated English
CAL_GREGORIAN_XLIT_FRENCHGregorian transliterated French
CalType
[in] Type of calendar information to be returned. See the listing of constant values in the "Remarks" section.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call the GetLastError function. The following table shows possible return values for GetLastError.

ValueDescription
ERROR_BADDBThe configuration registry database is corrupt.
ERROR_INVALID_FLAGSThe flags are invalid.
ERROR_INVALID_PARAMETERThe parameter is incorrect.

Remarks

For more information about LCID, see National Language support (NLS) Locale Identifiers.

The CALTYPE constants define particular pieces of calendar information. The following table shows CALTYPE constants that are mutually exclusive — that is, they cannot be used in combination with each other in a function call.

TypeDescription
CAL_ICALINTVALUEAn integer value indicating the calendar type of the alternate calendar.
CAL_IYEAROFFSETRANGEOne or more null-terminated strings that specify the year offsets for each of the era ranges. The last string has an extra terminating null character.
CAL_SABBREVDAYNAME1Abbreviated native name of the first day of the week.
CAL_SABBREVDAYNAME2Abbreviated native name of the second day of the week.
CAL_SABBREVDAYNAME3Abbreviated native name of the third day of the week.
CAL_SABBREVDAYNAME4Abbreviated native name of the fourth day of the week.
CAL_SABBREVDAYNAME5Abbreviated native name of the fifth day of the week.
CAL_SABBREVDAYNAME6Abbreviated native name of the sixth day of the week.
CAL_SABBREVDAYNAME7Abbreviated native name of the seventh day of the week.
CAL_SABBREVMONTHNAME1Abbreviated native name of the first month of the year.
CAL_SABBREVMONTHNAME2Abbreviated native name of the second month of the year.
CAL_SABBREVMONTHNAME3Abbreviated native name of the third month of the year.
CAL_SABBREVMONTHNAME4Abbreviated native name of the fourth month of the year.
CAL_SABBREVMONTHNAME5Abbreviated native name of the fifth month of the year.
CAL_SABBREVMONTHNAME6Abbreviated native name of the sixth month of the year.
CAL_SABBREVMONTHNAME7Abbreviated native name of the seventh month of the year.
CAL_SABBREVMONTHNAME8Abbreviated native name of the eighth month of the year.
CAL_SABBREVMONTHNAME9Abbreviated native name of the ninth month of the year.
CAL_SABBREVMONTHNAME10Abbreviated native name of the tenth month of the year.
CAL_SABBREVMONTHNAME11Abbreviated native name of the eleventh month of the year.
CAL_SABBREVMONTHNAME12Abbreviated native name of the twelfth month of the year.
CAL_SABBREVMONTHNAME13Abbreviated native name of the thirteenth month of the year, if it exists.
CAL_SCALNAMENative name of the alternate calendar.
CAL_SDAYNAME1Native name of the first day of the week.
CAL_SDAYNAME2Native name of the second day of the week.
CAL_SDAYNAME3Native name of the third day of the week.
CAL_SDAYNAME4Native name of the fourth day of the week.
CAL_SDAYNAME5Native name of the fifth day of the week.
CAL_SDAYNAME6Native name of the sixth day of the week.
CAL_SDAYNAME7Native name of the seventh day of the week.
CAL_SERASTRINGOne or more null-terminated strings that specify each of the Unicode codepoints specifying the era associated with the given CAL_IYEAROFFSETRANGE. The last string has an extra terminating null character. See example below.
CAL_SLONGDATELong date formats for this calendar type.
CAL_SMONTHNAME1Native name of the first month of the year.
CAL_SMONTHNAME2Native name of the second month of the year.
CAL_SMONTHNAME3Native name of the fifth month of the year.
CAL_SMONTHNAME4Native name of the fourth month of the year.
CAL_SMONTHNAME5Native name of the fifth month of the year.
CAL_SMONTHNAME6Native name of the sixth month of the year.
CAL_SMONTHNAME7Native name of the seventh month of the year.
CAL_SMONTHNAME8Native name of the eighth month of the year.
CAL_SMONTHNAME9Native name of the ninth month of the year.
CAL_SMONTHNAME10Native name of the tenth month of the year.
CAL_SMONTHNAME11Native name of the eleventh month of the year.
CAL_SMONTHNAME12Native name of the twelfth month of the year.
CAL_SMONTHNAME13Native name of the thirteenth month of the year, if it exists.
CAL_SSHORTDATEShort date formats for this calendar type.

If the native name for the day of the week or for a month is an empty string, that name is identical to the name given in the corresponding locale information and therefore is not duplicated here.

The CAL_IYEAROFFSETRANGE and CAL_SERASTRING values vary in format depending on the type of optional calendar. The following example shows the values for these types (for each supported alternate calendar type) along with the formula for how to use the CAL_IYEAROFFSETRANGE value to compute the correct year given the Gregorian current year value Y:

CAL_ICALINTVALUE = "1"
CAL_IYEAROFFSETRANGE = ""
CAL_SERASTRING = ""

CAL_ICALINTVALUE = "2"
CAL_IYEAROFFSETRANGE = ""
CAL_SERASTRING = ""

CAL_ICALINTVALUE = "3"
CAL_IYEAROFFSETRANGE = "1989\01926\01912\01868\0"
CAL_SERASTRING = "Ux337B\0Ux337C\0Ux337D\0Ux337E\0"
if (Y>=1989) { Y = (Y–1989)+1; } 
if (Y>=1926 && Y<1989) { Y = (Y–1926)+1; } 
if (Y>=1912 && Y<1926) { Y = (Y–1912)+1; }
if (Y>=1868 && Y<1912) { Y = (Y–1868)+1; } 
if (Y<1868) { Y = Y; } 

CAL_ICALINTVALUE = "4"
CAL_IYEAROFFSETRANGE = "1912\0"
CAL_SERASTRING = "Ux4E2D\0Ux83EF\0Ux6C11\0Ux570B\0"
if (Y>=1912) { Y = (Y–1912)+1; } 
if (Y<1912) { Y = Y; }

CAL_ICALINTVALUE = "5"
CAL_IYEAROFFSETRANGE = "2333\0"
CAL_SERASTRING = ""
Y = Y+2333;
 

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Winnls.h.
Link Library: Coreloc.lib.

See Also

National Language support (NLS) Locale Identifiers | EnumCalendarInfoProc | MAKELCID | EnumDateFormats


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft