IDataFunctions_4_0::GetLocaleInfo Method [C++]

Use this method to get information on the specified locale.

Definition

[C++]

HRESULT IDataFunctions_4_0::GetLocaleInfo(longvtInfo,
 VARIANTvtLocale,
 VARIANT*pvarRet);

[Visual Basic]

Function GetLocaleInfo(vtInfo As Long,
 vtLocale As Variant) As Variant

Parameters

  • vtInfo[C++]
    [in] A long that specifies the type of locale information to return in the pvarRet parameter. This value must map to one of the LCTYPE constants. For information about these constants, see the Win32 SDK Help.
  • vtInfo[Visual Basic]
    A Long that indicates the type of locale information to return. This value must map to one of the LCTYPE constants. For information about these constants, see the Win32 SDK Help.
  • vtLocale[C++]
    [in] A VARIANT that identifies the locale for which to return information. If this VARIANT is empty (VT_EMPTY) or null (VT_NULL), the method returns information for the locale specified by the most recent call to put_Locale.
  • vtLocale[Visual Basic]
    A Variant that identifies the locale for which to return information. If this Variant is empty (VT_EMPTY) or null (VT_NULL), the method returns information for the locale specified by the most recent call to put_Locale.
  • pvarRet[C++]
    [out, retval] A pointer to a VARIANT used to return the requested locale information.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns a string Variant that contains the requested locale information; otherwise, NULL is returned.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

[C++] The pvtRet parameter contains valid data only if the method completes successfully.

The Locale property stores a number value that indicates the default locale to be used by the DataFunctions methods to format date, time, money, and number information. For those DataFunctions methods take a locale value for a parameter, if that value is not supplied, the value of this property is used.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

Dim vtResult, lInfo
Set MSCSDataFunctions = Server.CreateObject("Commerce.DataFunctions")
' Set Locale to USA
myLocale = "1033"
MSCSDataFunctions.Locale = myLocale
vtResult = MSCSDataFunctions.GetLocaleInfo(lInfo, myLocale)

See Also

[C++]DataFunctions Object

[C++]IDataFunctions_4_0::get_Locale, put_Locale

[Visual Basic]DataFunctions Object

[Visual Basic]DataFunctions.Locale

Copyright © 2005 Microsoft Corporation.
All rights reserved.