IWCNDevice::Connect method (wcndevice.h)

The IWCNDevice::Connect method initiates the session.

Syntax

HRESULT Connect(
  [in] IWCNConnectNotify *pNotify
);

Parameters

[in] pNotify

A pointer to the implemented IWCNConnectNotify callback interface which specifies if a connection has been successfully established.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation has succeeded.
HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
The device does not support the connection options queued via IWCNDevice::Set.
WCN_E_PEER_NOT_FOUND
The device could not be located on the network.

Remarks

After calling this method you may not call any other IWCNDevice 'Set' methods. There is no way to cancel or roll back device settings once a connection has been established.

NULL can be passed via pNotify, in place of the IWCNConnectNotify callback interface to prevent notification from being sent when the connect operation is complete.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header wcndevice.h

See also

IWCNConnectNotify

IWCNDevice