IPortableDeviceConnector::Connect method (portabledeviceconnectapi.h)
The Connect method sends an asynchronous connection request to the MTP/Bluetooth device.
HRESULT Connect( IConnectionRequestCallback *pCallback );
A pointer to a IConnectionRequestCallback interface if the application wishes to be notified when the request is complete; otherwise, NULL. If multiple requests are being sent simultaneously using the same IPortableDeviceConnector object, a different instance of the callback object must be used.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
||The method succeeded.|
This method will queue a connect request and then return immediately. The connection request will result in a no-op if a device is already connected.
To be notified when the request is complete, applications should provide a pointer to the IConnectionRequestCallback interface.
If a previously paired MTP/Bluetooth device is within range, applications can call this method to instantiate the Windows Portable Devices (WPD) class driver stack for that device, so that the device can be communicated to using the WPD API.
|Minimum supported client||Windows 7 [desktop apps only]|
|Minimum supported server||None supported|