Share via


Retrieving Properties for Multiple Objects by Object Format

banner art

Previous Next

Retrieving Properties for Multiple Objects by Object Format

In addition to a bulk retrieval of properties for a collection of object identifiers, an application can also perform a bulk retrieval of properties for all objects of a particular type. As in the previous example, bulk retrieval for a given type requires that the device driver support bulk retrievals.

Your application can perform a bulk retrieval using the interfaces described in the following table.

Interface Description
IPortableDeviceContent Interface Provides access to the content-specific methods.
IPortableDeviceKeyCollection Interface Used to identify the properties to be retrieved.
IPortableDeviceProperties Interface Used to determine whether a given driver supports bulk operations.
IPortableDevicePropertiesBulk Interface Supports the bulk retrieval operation.
IPortableDevicePropVariantCollection Interface Used to store the object identifiers for the bulk operation.

The ReadContentPropertiesBulkFilteringFormat function in the sample application's ContentProperties.cpp module demonstrates a bulk retrieval operation for objects of a particular type or format.

The code found in the ReadContentPropertiesBulkFilteringFormat function is almost identical to the code found in the ReadContentPropertiesBulk function. (See the Retrieving Properties for Multiple Objects topic for a complete description of this function.)

The one primary difference occurs when the operation is queued. When filtering by type or format, the IPortableDevicePropertiesBulk::QueueGetValuesByObjectFormat method is called instead of the IPortableDevicePropertiesBulk::QueueGetValuesByObjectList method.

hr = pPropertiesBulk->QueueGetValuesByObjectFormat(WPD_OBJECT_FORMAT_WMA,
                                                   WPD_DEVICE_OBJECT_ID,
                                                   100,
                                                   pPropertiesToRead,
                                                   pCallback,
                                                   &guidContext;);

See Also

Previous Next