Share via


IPortableDevicePropVariantCollection::Add

banner art

Previous Next

IPortableDevicePropVariantCollection::Add

The Add method adds an item to the collection.

Syntax

  HRESULT Add(
  const PROPVARIANT*  pValue
);

Parameters

pValue

[in]  Pointer to a new PROPVARIANT object to add to the collection. This method copies the PROPVARIANT to the collection, so you should release your local copy of the variable by calling PropVariantClear after calling this method.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.

Remarks

If a caller tries to add an item of a different VARTYPE contained in the collection and the PROPVARIANT value cannot be changed by this interface automatically, this method will fail. To change the collection type manually, call IPortableDevicePropVariantCollection::ChangeType.

Requirements

Header: Defined in PortableDeviceTypes.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next