ICatalogManager::AddDefinitionVariantProperty

Ee799168.c++_off(en-US,CS.10).gifEe799168.vb_on(en-US,CS.10).gif

Use this method to add a variant property to a definition. This method is similar to the AddDefinitionProperty method. The properties added with this method will only be used by product variants.

Definition

HRESULT ICatalogManager::AddDefinitionVariantProperty(BSTRstrDefinitionName,BSTRstrPropertyName);

Parameters

strDefinitionName

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

strPropertyName

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

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 variant property to a definition. Any product variants 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::AddDefinitionProperty

ICatalogManager::RemoveDefinitionProperty


All rights reserved.