Share via


IProductCatalog3::RemoveLanguage Method [C++]

Use this method to remove a language from this catalog.

Definition

[C++]

HRESULT IProductCatalog3::RemoveLanguage(BSTRstrLanguage);

[Visual Basic]

Sub RemoveLanguage(strLanguage As String)

Parameters

  • strLanguage[C++]
    [in, optional, defaultvalue ("")] A BSTR that contains the culture name to remove. 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 remove. 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 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.

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_NOT_ASSOCIATED

[C++] 0x889800A4

[Visual Basic] &H889800A4

The language that you specified is not associated with this catalog.
E_CAT_CATALOG_DOESNT_EXIST

[C++] 0x88980002

[Visual Basic] &H88980002

The catalog name you specified does not exist.
E_CAT_CANNOT_REMOVE_DEFAULT_LANG

[C++] 0x889800AA

[Visual Basic] &H889800AA

The language that you specified is being used as the Default language for this catalog. It cannot be removed
E_CAT_CANNOT_REMOVE_REPORTING_LANG

[C++] 0x889800AB

[Visual Basic] &H889800AB

The language that you specified is being used as the Reporting language for this catalog. It cannot be removed

Remarks

This method removes the specified language from list of languages supported by the catalog. The language will not be removed if it is the default language of the catalog; in this case, an error message will be returned.

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

[Visual Basic]

Example

myProductCatalog.RemoveLanguage("FRA")

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.