Platform SDK: International Features

GetCalendarInfo

The GetCalendarInfo function retrieves information about a calendar.

int GetCalendarInfo(
  LCID Locale,       // locale
  CALID Calendar,    // calendar identifier
  CALTYPE CalType,   // calendar type
  LPTSTR lpCalData,  // information buffer
  int cchData,       // information buffer size
  LPDWORD lpValue    // data
);

Parameters

Locale
[in] Locale identifier (LCID). This can be created by the MAKELCID macro, or it can be one of the following predefined values.
Value Meaning
LOCALE_SYSTEM_DEFAULT Default-system locale.
LOCALE_USER_DEFAULT Default-user locale.

Calendar
[in] Calendar identifier.
CalType
[in] Specifies the type of information to retrieve. For more information, see Calendar Type Information.
lpCalData
[out] Pointer to a buffer that receives the requested data as a string. If CAL_RETURN_NUMBER is specified in CalType, then lpCalData must be NULL.
cchData
[in] Specifies the size, in TCHARs, of the lpCalData buffer. If cchData is zero, the function returns the number of bytes or characters required to hold the information, and the buffer pointed to by lpCalData is not used. If CAL_RETURN_NUMBER is specified in CalType, then cchData must be 0.
lpValue
[out] Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.

Return Values

If the function succeeds and cchData is nonzero, the return value is the number of TCHARs written to the lpCalData buffer. If the function succeeds and cchData is zero and CAL_RETURN_NUMBER is not specified, the return value is the number of bytes or characters required to hold the locale information. If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:

Remarks

Windows 98: The only CAL_* types supported are:

Windows 2000: The ANSI version of this function will fail if it is used with a Unicode-only LCID. See Language Identifiers.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Winnls.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

National Language Support Overview, National Language Support Functions, SetCalendarInfo