PeerCollabInviteEndpoint function (p2p.h)

The PeerCollabInviteEndpoint function sends an invitation to a specified peer endpoint to join the sender's peer collaboration activity. This call is synchronous and, if successful, obtains a response from the peer endpoint.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerCollabInviteEndpoint(
  [in]  PCPEER_ENDPOINT           pcEndpoint,
  [in]  PCPEER_INVITATION         pcInvitation,
  [out] PPEER_INVITATION_RESPONSE *ppResponse
);

Parameters

[in] pcEndpoint

Pointer to a PEER_ENDPOINT structure that contains information about the invited peer. This peer is sent an invitation when this API is called.

This parameter must not be set to NULL.

[in] pcInvitation

Pointer to a PEER_INVITATION structure that contains the invitation request to send to the endpoint specified in pcEndpoint. This parameter must not be set to NULL.

[out] ppResponse

Pointer to a PEER_INVITATION_RESPONSE structure that receives an invited peer endpoint's responses to the invitation request.

If this call fails with an error, on output this parameter will be NULL.

Free the memory associated with this structure by pass it to PeerFreeData.

Return value

Returns S_OK if the function succeeds. Otherwise, the function returns one of the following values.

Return code Description
E_OUTOFMEMORY
There is not enough memory to support this operation.
E_INVALIDARG
One of the arguments is invalid.
PEER_E_TIMEOUT
The recipient of the invitation has not responded within 5 minutes.

Remarks

This API sends an invitation to the endpoint specified as input. It does not guarantee that the recipient of the invite is the specific contact that the user intended to send the invite to. To ensure that the invitation is sent to the correct contact, call PeerCollabInviteContact.

A toast will appear for the recipient of the invitation. This toast will be converted to a dialog box in which the user can accept or decline the invitation. When the invitation is successfully accepted, the collaborative application is launched on the recipient's machine.

To successfully receive the invitation, the application must be registered on the recipient's machine using PeerCollabRegisterApplication. It is also possible for the sender of the invite to have failure codes returned because the recipient has turned off application invites.

The recipient of the invitation must respond within 5 minutes to avoid timeout.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PEER_ENDPOINT

PEER_INVITATION

PEER_INVITATION_RESPONSE

Peer Collaboration API Functions

PeerCollabGetAppLaunchInfo