ICatalogManager::AddDefinitionProperty

Ee824950.c++_off(en-US,CS.10).gifEe824950.vb_on(en-US,CS.10).gif

Use this method to add an existing property to an existing category or product definition.

Definition

HRESULT ICatalogManager::AddDefinitionProperty(BSTRstrDefinitionName,BSTRstrPropertyName);

Parameters

strDefinitionName

[in] A BSTR that contains the name of the definition to which the property will be added.

strPropertyName

[in] A BSTR that contains the name of the property.

Return Values

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

Error Values

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.

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

Constant Value Description
E_CAT_DEFINITION_DOESNT_EXIST 0x8898000B The specified definition did not exist.
E_CAT_PROP_DOESNT_EXIST 0x88980005 The specified property did not exist.
E_CAT_PROP_IN_DEFINITION 0x8898000D The specified property was already in the definition.
OLE_E_BLANK 0x80040007 The object was not initialized. The Initialize method must be called before calling any other method.

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.

Remarks

This method adds a property to a definition. Any products or categories created from the definition will also have the property. A property can only be added to a definition once. A property cannot be used in a product definition as both a property and a variant property.

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

See Also

CatalogManager Object

ICatalogManager::AddDefinitionVariantProperty

ICatalogManager::RemoveDefinitionProperty


All rights reserved.