IProduct3::DeleteVariant Method [C++]

Use this method to delete the specified product variant. This method applies to base catalogs only.

Definition

[C++]

HRESULT IProduct3::DeleteVariant(VARIANTvarVariantID);

[Visual Basic]

Sub DeleteVariant(varVariantID As Variant)

Parameters

  • varVariantID[C++]
    [in] A VARIANT that contains the unique ID of the variant.
  • varVariantID[Visual Basic]
    A Variant that contains the unique ID of the variant.

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_SUPPLIER_CATALOG

[C++] 0x889800F9

[Visual Basic] &H889800F9

Invalid catalog type. This API can only be called on a base catalog.
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS

[C++] 0x88980032

[Visual Basic] &H88980032

This catalog does not support variants. In order to support variants, the catalog has to be created with variant identifier.
E_CAT_INVALID_PARAMETER

[C++] 0x889800B6

[Visual Basic] &H889800B6

The input parameter <parameter number> is invalid.
E_CAT_INVALID_VARIANTID

[C++] 0x8898005C

[Visual Basic] &Hx8898005C

The value you specified for the VariantID exceeds the maximum allowed length of 256 characters.
E_CAT_INVALIDVALUE_FOR_VARIANTID

[C++] 0x8898004D

[Visual Basic] &H8898004D

The value you specified for the VariantID is either out of range or does not satisfy the Min/Max condition.
E_CAT_BLANK_VARIANT

[C++] 0x8898004F

[Visual Basic] &H8898004F

You have specified a blank value for the VariantID. A variant cannot be created with a blank value.
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_VARIANT_DOESNT_EXIST

[C++] 0x8898001F

[Visual Basic] &H8898001F

The product-variant you specified 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

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

[Visual Basic]

Example

'vVarID is a Variant containing the unique ID 
'for the product variant.
myProduct.DeleteVariant vVarID

See Also

[C++]Product Object

[Visual Basic]Product Object

[C++]IProduct3::CreateVariant

[Visual Basic]Product.CreateVariant

Copyright © 2005 Microsoft Corporation.
All rights reserved.