IProductCatalog3::AddLanguage Method [C++]

Use this method to add support for an additional language.

Definition

[C++]

HRESULT IProductCatalog3::AddLanguage(BSTRstrLanguage);

[Visual Basic]

Sub AddLanguage(strLanguage As String)

Parameters

  • strLanguage[C++]
    [in, optional, defaultvalue ("")] A BSTR that contains the culture name to be added. The culture name follows the RFC 1766 standard in the format "<languagecode2>-<country/regioncode2>" where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. Some culture names have prefixes that specify the script; for example, "Cy" specifies the Cyrillic script, and "Lt" specifies the Latin script. For more information, see . Table of Language Culture Names, Culture Codes, and ISO Values.
  • strLanguage[Visual Basic]
    A String that that contains the culture name to be added. The culture name follows the RFC 1766 standard in the format "<languagecode2>-<country/regioncode2>" where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. Some culture names have prefixes that specify the script; for example, "Cy" specifies the Cyrillic script, and "Lt" specifies the Latin script. For more information, see . Table of Language Culture Names, Culture Codes, and ISO Values.

Return Values

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

[Visual Basic] None.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_CAT_INVALID_LANGUAGE

[C++] 0x8898009E

[Visual Basic] &H8898009E

The value you specified for the Language parameter is either empty or exceeds the maximum length of 10 characters.
E_CAT_LANGUAGE_ALREADY_EXISTS

[C++] 0x889800A0

[Visual Basic] &H889800A0

The language you specified already exists in the catalog.

[C++] 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] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

This method adds the specified language to the list of languages supported by the catalog. It will use default values if default values are specified for the property and language.

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

[Visual Basic]

Example

myProductCatalog.AddLanguage("FRA")

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.