Share via


IPortableDevice Interface

banner art

Previous Next

IPortableDevice Interface

The IPortableDevice interface provides access to a portable device.

To create and open this interface, first call CoCreateInstance with CLSID_PortableDevice to retrieve an IPortableDevice interface, and then call IPortableDevice::Open to open a connection to the device.

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

Method Description
Advise Registers an application-defined callback that receives device events.
Cancel Cancels a pending operation on this interface.
Capabilities Retrieves an interface used to query the capabilities of a portable device.
Close Closes the connection with the device.
Content Retrieves an interface used to access objects on a device.
GetPnPDeviceID Retrieves a Plug and Play (PnP) identifier used to open a device.
Open Opens a connection between the application and the device.
SendCommand Sends a command to the device and retrieves the results synchronously.
Unadvise Unregisters a client from receiving callback notifications.

Remarks

The client interfaces are designed to be used for any WPD object; it is not necessary to create a new instance for each object referenced by the application. After an application opens an instance of the IPortableDevice interface, it should open and cache any other WPD client interfaces that it will require.

Requirements

Header: Defined in PortableDeviceApi.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next