Compartilhar via


IPortableDeviceValues Interface

banner art

Previous Next

IPortableDeviceValues Interface

The IPortableDeviceValues interface holds a collection of PROPERTYKEY/PROPVARIANT pairs. Values in the collection do not need to be the same VARTYPE.

Values are stored as key-value pairs; each key must be unique in the collection. Clients can search for items by PROPERTYKEY or zero-based index. Data values are stored as PROPVARIANT structures. You can add or retrieve values of any type by using the generic methods SetValue and GetValue, or you add items by using the method specific to the type of data added.

The Get... methods require the caller to release any retrieved values appropriately. The Set... methods copy the value into the collection.

When an IPortableDeviceValues interface is released, it calls Clear, which frees the memory that was allocated for all its members appropriately.

This interface can be retrieved from a method or, if a new object is required, call CoCreate with CLSID_PortableDeviceValues.

In addition to the methods inherited from IUnknown, the IPortableDeviceValues interface exposes the following methods.

Method Description
Clear Deletes all items from the collection.
CopyValuesFromPropertyStore Copies the contents of an IPropertyStore into the collection.
CopyValuesToPropertyStore Copies all the values from a collection into an IPropertyStore interface.
GetAt Retrieves a value from the collection using the supplied zero-based index.
GetBoolValue Retrieves a BOOL value (type VT_BOOL) specified by a key.
GetBufferValue Retrieves a byte array value (type VT_VECTOR | VT_UI1) specified by a key.
GetCount Retrieves the number of items in the collection.
GetErrorValue Retrieves an HRESULT value (type VT_ERROR) specified by a key.
GetFloatValue Retrieves a FLOAT value (type VT_R4) specified by a key.
GetGuidValue Retrieves a GUID value (type VT_CLSID) specified by a key.
GetIPortableDeviceKeyCollectionValue Retrieves an IPortableDeviceKeyCollection value (type VT_UNKNOWN) specified by a key.
GetIPortableDevicePropVariantCollectionValue Retrieves an IPortableDevicePropVariantCollection value (type VT_UNKNOWN) specified by a key.
GetIPortableDeviceValuesCollectionValue Retrieves an IPortableDeviceValuesCollection value (type VT_UNKNOWN) specified by a key.
GetIPortableDeviceValuesValue Retrieves an IPortableDeviceValues value (type VT_UNKNOWN) specified by a key.
GetIUnknownValue Retrieves an IUnknown interface value (type VT_UNKNOWN) specified by a key.
GetKeyValue Retrieves a PROPERTYKEY value specified by a key.
GetSignedIntegerValue Retrieves a LONG value (type VT_I4) specified by a key.
GetSignedLargeIntegerValue Retrieves a LONGLONG value (type VT_I8) specified by a key.
GetStringValue Retrieves a string value (type VT_LPWSTR) specified by a key.
GetUnsignedIntegerValue Retrieves a ULONG value (type VT_UI4) specified by a key.
GetUnsignedLargeIntegerValue Retrieves a ULONGLONG value (type VT_UI8) specified by a key.
GetValue Retrieves a PROPVARIANT value specified by a key.
RemoveValue Removes an item from the collection.
SetBoolValue Adds a new Boolean value (type VT_BOOL) or overwrites an existing one.
SetBufferValue Adds a new BYTE* value (type VT_VECTOR | VT_UI1) or overwrites an existing one.
SetErrorValue Adds a new HRESULT value (type VT_ERROR) or overwrites an existing one.
SetFloatValue Adds a new FLOAT value (type VT_R4) or overwrites an existing one.
SetGuidValue Adds a new GUID value (type VT_CLSID) or overwrites an existing one.
SetIPortableDeviceKeyCollectionValue Adds a new IPortableDeviceKeyCollectionValue value (type VT_UNKNOWN) or overwrites an existing one.
SetIPortableDevicePropVariantCollectionValue Adds a new IPortableDevicePropVariantCollection value (type VT_UNKNOWN) or overwrites an existing one.
SetIPortableDeviceValuesCollectionValue Adds a new IPortableDeviceValuesCollection value (type VT_UNKNOWN) or overwrites an existing one.
SetIPortableDeviceValuesValue Adds a new IPortableDeviceValues value (type VT_UNKNOWN) or overwrites an existing one.
SetIUnknownValue Adds a new IUnknown value (type VT_UNKNOWN) or overwrites an existing one.
SetKeyValue Adds a new PROPERTYKEY (type VT_UNKNOWN) value or overwrites an existing one.
SetSignedIntegerValue Adds a new LONG value (type VT_I4) or overwrites an existing one.
SetSignedLargeIntegerValue Adds a new LONGLONG value (type VT_I8) or overwrites an existing one.
SetStringValue Adds a new string value (type VT_LPWSTR) or overwrites an existing one.
SetUnsignedIntegerValue Adds a new ULONG value (type VT_UI4) or overwrites an existing one.
SetUnsignedLargeIntegerValue Adds a new ULONGLONG value (type VT_UI8) or overwrites an existing one.
SetValue Adds a new PROPVARIANT value or overwrites an existing one.

Requirements

Header: Defined in PortableDeviceTypes.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next