GetCalendarInfoEx function (winnls.h)
Retrieves information about a calendar for a locale specified by name.
Syntax
int GetCalendarInfoEx(
[in, optional] LPCWSTR lpLocaleName,
[in] CALID Calendar,
[in, optional] LPCWSTR lpReserved,
[in] CALTYPE CalType,
[out, optional] LPWSTR lpCalData,
[in] int cchData,
[out, optional] LPDWORD lpValue
);
Parameters
[in, optional] lpLocaleName
Pointer to a locale name, or one of the following predefined values.
[in] Calendar
[in, optional] lpReserved
Reserved; must be NULL.
[in] CalType
Type of information to retrieve. For more information, see Calendar Type Information.
[out, optional] lpCalData
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.
[in] cchData
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.
[out, optional] lpValue
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
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
Target Platform | Windows |
Header | winnls.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |