ICatalogManager3::CreateCategoryDefinition Method [C++]

Use this method to create a new category definition.

Definition

[C++]

HRESULT ICatalogManager3::CreateCategoryDefinition(BSTRstrDefinitionName);

[Visual Basic]

Sub CreateCategoryDefinition(strDefinitionName As String)

Parameters

  • strDefinitionName[C++]
    [in] A BSTR that contains the name of the new category definition.
  • strDefinitionName[Visual Basic]
    A String that contains the name of the new category definition.

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.

Name Value Description
E_CAT_CATMGR_NOT_INITIALIZED

[C++] 0x889800B

[Visual Basic] &H8898005

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method
E_CAT_INVALID_DEFINITION_LENGTH

[C++] 0x889800E

[Visual Basic] &H889800A

The definition name that you specified is invalid. Definition names should be between 1 and 128 characters in length.
E_CAT_DEFINITION_EXISTS

[C++] 0x8898000

[Visual Basic] &H889800A

The Definition you specified already exists.
E_CAT_DEFN_NAME_EXISTS_AS_PRODUCT

[C++] 0x8898004

[Visual Basic] &H8898004

A product definition with the name you specified already exists. Definition names should be unique across Category and Product definitions.

[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

Category and product definition names must be globally unique across the entire Product Catalog System. It is not possible to have a category definition and a product definition with the same name.

The initial definition is empty when it is created. To add individual properties to the definition, use the AddDefinitionProperty method.

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

[Visual Basic]

Example

myCatalogManager.CreateCategoryDefinition "Housewares" 

See Also

[C++]CatalogManager Object

[Visual Basic]CatalogManager Object

[C++]ICatalogManager3::AddDefinitionProperty

[Visual Basic]CatalogManager.AddDefinitionProperty

[C++]ICatalogManager3::CreateProductDefinition

[Visual Basic]CatalogManager.CreateProductDefinition

[C++]ICatalogManager3::DeleteDefinition

[Visual Basic]CatalogManager.DeleteDefinition

Copyright © 2005 Microsoft Corporation.
All rights reserved.