Skip to content

Latest commit

 

History

History
156 lines (116 loc) · 6.04 KB

nf-winnls-setcalendarinfoa.md

File metadata and controls

156 lines (116 loc) · 6.04 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winnls.SetCalendarInfoA
SetCalendarInfoA function (winnls.h)
Sets an item of locale information for a calendar. For more information, see Date and Calendar. (ANSI)
SetCalendarInfoA
winnls/SetCalendarInfoA
intl\setcalendarinfo.htm
Intl
3599f68f-5b7c-4bf9-9c42-452047c0731f
12/05/2018
SetCalendarInfo, SetCalendarInfo function [Internationalization for Windows Applications], SetCalendarInfoA, SetCalendarInfoW, _win32_SetCalendarInfo, intl.setcalendarinfo, winnls/SetCalendarInfo, winnls/SetCalendarInfoA, winnls/SetCalendarInfoW
winnls.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
SetCalendarInfoW (Unicode) and SetCalendarInfoA (ANSI)
Kernel32.lib
Kernel32.dll
Windows
19H1
SetCalendarInfoA
winnls/SetCalendarInfoA
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Localization-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-Localization-l1-2-0.dll
API-MS-Win-Core-Localization-l1-2-1.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
API-MS-Win-Core-Localization-L1-2-2.dll
API-MS-Win-Core-Localization-Ansi-L1-1-0.dll
Kernel32Legacy.dll
SetCalendarInfo
SetCalendarInfoA
SetCalendarInfoW

SetCalendarInfoA function

-description

Sets an item of locale information for a calendar. For more information, see Date and Calendar.

-parameters

-param Locale [in]

Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.

The following custom locale identifiers are also supported.

-param Calendar [in]

Calendar identifier for the calendar for which to set information.

-param CalType [in]

Type of calendar information to set. Only the following CALTYPE values are valid for this function. The CAL_USE_CP_ACP constant is only meaningful for the ANSI version of the function.

  • CAL_USE_CP_ACP
  • CAL_ITWODIGITYEARMAX
The application can specify only one calendar identifier per call to this function. An exception can be made if the application uses the binary OR operator to combine CAL_USE_CP_ACP with any valid CALTYPE value defined in Calendar Type Information.

-param lpCalData [in]

Pointer to a null-terminated calendar information string. The information must be in the format of the specified calendar type.

-returns

Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INTERNAL_ERROR. An unexpected error occurred in the function.
  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

-remarks

This function only affects the user override portion of the calendar settings. It does not set the system defaults.

Calendar information is always passed as a null-terminated Unicode string in the Unicode version of this function, and as a null-terminated ANSI string in the ANSI version. No integers are allowed by this function. Any numeric values must be specified as either Unicode or ANSI text.

When the ANSI version of this function is used with a Unicode-only locale identifier, the function can succeed because the operating system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).

CAL_ITWODIGITYEARMAX can be used with any calendar, even if the calendar is not supported for the specified locale. To avoid complications, the application should call EnumCalendarInfo to ensure that the calendar is supported for the locale of interest.

Note

The winnls.h header defines SetCalendarInfo as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

EnumCalendarInfo

GetCalendarInfo

National Language Support

National Language Support Functions