ICategory3::RemoveParentCategory Method [C++]

Use this method to remove the specified category as a parent of this category.

Definition

[C++]

HRESULT ICategory3::RemoveParentCategory(BSTRstrCategoryName);

[Visual Basic]

Sub RemoveParentCategory(strCategoryName As String)

Parameters

  • strCategoryName[C++]
    [in] A BSTR that contains the name of the category to be removed as a parent to this category.
  • strCategoryName[Visual Basic]
    A String that contains the name of the category to be removed as a parent to this category.

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_OPERATION_FOR_ROOT_CATEGORY

[C++] 0x889800F8

[Visual Basic] &H889800F8

This API cannot be called for a root category.
E_CAT_INVALID_CATEG_LENGTH

[C++] 0x88980047

[Visual Basic] &H88980047

The category name you specified is either blank or exceeds the maximum allowed length of 128 characters or cannot be converted to a string.
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_CATEGORY_DOESNT_EXIST

[C++] 0x8898001C

[Visual Basic] &H8898001C

The category you specified doesn't exist.
E_CAT_VC_ERROR_IN_PROPAGATING_BC_CHANGES

[C++] 0x88980101

[Visual Basic] &H88980101

There was an error in propagating the base catalog changes to the dependent virtual catalogs.

[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

Use the RemoveParentCategory method to remove a parent category from this category. If the category specified in the strCategoryName parameter does not exist, then this method will fail.

When calling this method on an inherited category in a virtual catalog, the method will have no effect if the parent-category relationship is inherited from a base catalog. If the relationship was added in the virtual catalog it will be removed. Inherited hierarchy and relationship links cannot be removed or changed in inherited categories. To modify inherited relationships use a Category object obtained from the base Catalog object.

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

[Visual Basic]

Example

myCategory.RemoveParentCategory "Apparel"

See Also

[C++]Category Object

[C++]ICategory3::AddParentCategory

[C++]ICategory3::RemoveChildCategory

[Visual Basic]Category Object

[Visual Basic]Category.AddParentCategory

[Visual Basic]Category.RemoveChildCategory

Copyright © 2005 Microsoft Corporation.
All rights reserved.