IPortableDeviceDispatchFactory::GetDeviceDispatch method (portabledeviceapi.h)

Instantiates a WPD Automation Device object for a given WPD device identifier.

Syntax

HRESULT GetDeviceDispatch(
  [in]  LPCWSTR   pszPnPDeviceID,
  [out] IDispatch **ppDeviceDispatch
);

Parameters

[in] pszPnPDeviceID

A pointer to a String that is used by Plug-and-play to identify a currently connected WPD device. The Plug and Play (PnP) identifier for a particular device can be obtained from the IPortableDeviceManager::GetDevices method in the WPD C++/COM API.

[out] ppDeviceDispatch

Contains a pointer to the IDispatch implementation for the WPD Automation Device object.

Return value

The possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
S_OK
The method succeeded.

Remarks

For an example of how to use GetDeviceDispatch method to instantiate a WPD Automation Device object, see Instantiating the WPD Automation Factory Interface.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header portabledeviceapi.h
Library PortableDeviceGuids.lib

See also

Device Object

IPortableDeviceDispatchFactory Interface

Instantiating the WPD Automation Factory Interface