IDirectPlay4::AddPlayerToGroup

IDirectPlay4 Interface

Add 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).

Syntax

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 Value

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 the player DPID 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.

See Also

IDirectPlay4::CreateGroup, IDirectPlay4::DeletePlayerFromGroup, DPMSG_ADDPLAYERTOGROUP


Top of Page Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.