Share via


IProductCatalog3::RemoveVirtualCatalogRule Method [C++]

Use this method to remove a virtual catalog rule.

Definition

[C++]

HRESULT IProductCatalog3::RemoveVirtualCatalogRule(BSTRstrCatalogName,
  VARIANTvrProductIDOrCategoryName,
  VARIANTvrVariantID,
  VARIANT_BOOLfCategory);

[Visual Basic]

Sub RemoveVirtualCatalogRule(strCatalogName As String,
  vrProductIDOrCategoryName As Variant,
  vrVariantID As Variant,
  Optional fCategory As Boolean)

Parameters

  • strCatalogName[C++]
    [in] A BSTR that contains the base catalog name.
  • strCatalogName[Visual Basic]
    A String that contains the base catalog name.
  • vrProductIDOrCategoryName[C++]
    [in] A VARIANT that contains the product ID or category name to which the rule applies.
  • vrProductIDOrCategoryName[Visual Basic]
    A Variant that contains the product ID or category name to which the rule applies.
  • vrVariantID[C++]
    [in] A VARIANT that contains the variant ID to which the rule applies.
  • vrVariantID[Visual Basic]
    A Variant that contains the variant ID to which the rule applies.
  • fCategory[C++]
    [in, optional, defaultvalue (0)] A VARIANT_BOOL that specifies whether the parameter vrProductIDOrCategoryName is a product or a category. A value of True (-1) indicates a category. A value of False (0) indicates a product.
  • fCategory[Visual Basic]
    A Boolean that specifies whether the parameter vrProductIDOrCategoryName is a product or a category. A value of True (-1) indicates a category. A value of False (0) indicates a product. The default value is False (0).

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_VC_NOT_A_VIRTUAL_CATALOG

[C++] 0x889800FA

[Visual Basic] &H889800FA

Invalid catalog type. This API can only be called on a virtual catalog.
E_CAT_INVALID_CATALOGNAME

[C++] 0x88980063

[Visual Basic] &H88980063

The catalog Name you specified is invalid. Catalog names cannot be blank.
E_CAT_INVALID_CATALOG_NAME_LENGTH

[C++] 0x88980042

[Visual Basic] &Hx88980042

The catalog name you specified exceeds the maximum limit of 85 characters.
E_CAT_CHARACTER_NOT_ALLOWED

[C++] 0x8898003D

[Visual Basic] &H8898003D

The catalog name you specified has one of the nine reserved characters " [ ] , ' ( )#. which should not be used.
E_CAT_VC_INVALID_PROD_ID_OR_CATEGORY_NAME

[C++] 0x889800FB

[Visual Basic] &H889800FB

The value you specified for the ProductID or CategoryName exceeds the maximum allowed length of 348 characters.
E_CAT_VC_INVALID_VARIANT_ID

[C++] 0x889800FC

[Visual Basic] &H889800FC

The value you specified for the VariantID exceeds the maximum allowed length of 348 characters.
E_CAT_VC_INVALID_ITEM

[C++] 0x889800FD

[Visual Basic] &H889800FD

The specified product/category/variant could not be found in the base catalog.
E_CAT_VC_DELETION_RULE_NOT_FOUND

[C++] 0x889800FE

[Visual Basic] &H889800FE

The rule could not be deleted because it doesn't exist.

[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

Set the fCategory parameter to True and the vrProductIDOrCategoryName parameter to an empty string to remove the rule for the catalog specified in the strCatalogName parameter.

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

[Visual Basic]

Example

' The following example removes the rule for the "Shoes" catalog.
myVCatalog.RemoveVirtualCatalogRule("Shoes", "", True)

' The following exampe removes the rule for the "Mens" category
' in the "Shoe" catalog.
myVCatalog.RemoveVirtualCatalogRule("Shoes", "Mens", True)

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.