EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

GetCalendarInfoEx function

Retrieves information about a calendar for a locale specified by name.

Note  The application should call this function in preference to GetCalendarInfo if designed to run only on Windows Vista and later.

Note  This function can retrieve data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data.

Syntax


int GetCalendarInfoEx(
  _In_opt_   LPCWSTR lpLocaleName,
  _In_       CALID Calendar,
  _In_opt_   LPCWSTR lpReserved,
  _In_       CALTYPE CalType,
  _Out_opt_  LPWSTR lpCalData,
  _In_       int cchData,
  _Out_opt_  LPDWORD lpValue
);

Parameters

lpLocaleName [in, optional]

Pointer to a locale name, or one of the following predefined values.

Calendar [in]

Calendar identifier.

lpReserved [in, optional]

Reserved; must be NULL.

CalType [in]

Type of information to retrieve. For more information, see Calendar Type Information.

Note  GetCalendarInfoEx returns only one string if this parameter specifies CAL_IYEAROFFSETRANGE or CAL_SERASTRING. In both cases the current era is returned.

For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the current system default locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX. CAL_ITWODIGITYEARMAX is the only value that can be set by SetCalendarInfo.

lpCalData [out, optional]

Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in CalType, this parameter must retrieve NULL.

cchData [in]

Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the calendar data buffer. In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value of cchData must be 0.

lpValue [out, optional]

Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue must not be NULL. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.

Return value

Returns the number of characters retrieved in the lpCalData buffer if successful. If the function succeeds, cchData is set to 0, and CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the locale information. If the function succeeds, cchData is set to 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value written to the lpValue parameter. This size is always 2.

The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

Beginning in Windows 8: If your app passes language tags to this function from the Windows.Globalization namespace, it must first convert the tags by calling ResolveLocaleName.

Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Winnls.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

National Language Support
National Language Support Functions
Calendar Type Information
GetCalendarInfo
SetCalendarInfo

 

 

커뮤니티 추가 항목

추가
표시:
© 2014 Microsoft