Share via


IPortableDeviceValues::GetValue

banner art

Previous Next

IPortableDeviceValues::GetValue

The GetValue method retrieves a PROPVARIANT value specified by a key.

Syntax

  HRESULT GetValue(
  REFPROPERTYKEY  key,
  PROPVARIANT*  pValue
);

Parameters

key

[in]  A REFPROPERTYKEY key that specifies the item to retrieve.

pValue

[out]  Pointer to the retrieved PROPVARIANT value. The caller must release the memory by calling PropVariantClear when done with it.

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.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND) The property specified by key is not in the collection.

Remarks

This method can be used to retrieve a value of any type from the collection. However, if you know the value type in advance, use one of the specialized retrieval methods of this interface to avoid the overhead of working with PROPVARIANT values directly.

Requirements

Header: Defined in PortableDeviceTypes.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next