DirectX SDK

IDirectPlay4::AddPlayerToGroup

The IDirectPlay4::AddPlayerToGroup method adds a player to an existing group. A player can be a member of multiple groups. Groups cannot be added to other groups using this API (see IDirectPlay4::AddGroupToGroup). An application can add any player to any group (including players and groups that weren't created locally).

HRESULT AddPlayerToGroup(
  DPID idGroup,
  DPID idPlayer
);

Parameters

idGroup
Group ID of the group to be augmented.
idPlayer
Player ID of the player to be added to the group.

Return Values

Returns DP_OK if successful, or one of the following error values otherwise:

DPERR_CANTADDPLAYER
DPERR_CONNECTIONLOST
DPERR_INVALIDGROUP
DPERR_INVALIDPLAYER
DPERR_NOSESSIONS

This method returns DPERR_INVALIDPLAYER if idPlayer is not a player ID or if the ID is not for a local player.

Remarks

A DPMSG_ADDPLAYERTOGROUP system message will be generated and sent to all the other players.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dplay.h.
  Import Library: Use dplayx.lib.

See Also

IDirectPlay4::CreateGroup, IDirectPlay4::DeletePlayerFromGroup, DPMSG_ADDPLAYERTOGROUP