Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function retrieves information about a locale.
Note: |
---|
If you specify a locale with the LCID (Locale ID) parameter and that locale is not installed or available on the Windows ®phone, the function fails with ERROR_INVALID_PARAMETER. To determine whether the locale is supported or not, call IsValidLocale. |
Syntax
int GetLocaleInfo( LCID Locale, LCTYPE LCType, LPTSTR lpLCData, int cchData ); |
Parameters
- Locale
-
[in] Value that specifies the locale to retrieve information for. This parameter can only be a locale identifier created by the MAKELCIDmacro, or one of the following predefined values. The following table shows the values this parameter can take.
Value Description LOCALE_SYSTEM_DEFAULT
Default system locale.
LOCALE_USER_DEFAULT
Default user locale.
LOCALE_NEUTRAL
Default language-neutral locale.
- LCType
-
[in] Value that specifies one of the LCTYPE constants to indicate the type of information to be retrieved.
All LCTYPEvalues are mutually exclusive, with the exception of LOCALE_NOUSEROVERRIDE. An application may use the binary-OR operator to combine LOCALE_NOUSEROVERRIDEwith any other LCTYPEvalue. If passed such an LCTypevalue, the function bypasses user overrides, and returns the system default value for the requested LCID.
- lpLCData
-
[out] Pointer to a buffer to receive the requested data.
- cchData
-
[in] Size, in characters, of the lpLCDatabuffer. If cchDatais zero, the function returns the number of characters required to hold the information, and the buffer pointed to by lpLCDatais not used.
Return Value
The number of bytes or characters written to the destination buffer, or, if the cchDataparameter is zero, the number of characters required to hold the locale information indicates success. Zero indicates failure. To get extended error information, call the GetLastErrorfunction. The following table shows possible return values for the GetLastErrorfunction.
Value | Description |
---|---|
ERROR_INSUFFICIENT_BUFFER |
The data area passed to a system call is too small. |
ERROR_INVALID_FLAGS |
The flags are invalid. |
ERROR_INVALID_PARAMETER |
The parameter is incorrect, or the specified LCID is not supported on the device. |
Remarks
The GetLocaleInfofunction always retrieves information in text format. If the information is a numeric value, the function converts the number to text using decimal notation.
For more information about locales, see National Language Support (NLS) Locale Identifiers.
Requirements
Header | winnls.h |
Library | Coreloc.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
MAKELCIDLCTYPE Constants