DirectX SDK

DirectPlay4.AddPlayerToGroup

The DirectPlay4.AddPlayerToGroup method adds a player to an existing group. A player can be a member of multiple groups. An application can add any player to any group (including players and groups that were not created locally). A group cannot be added to another group by using this method (see DirectPlay4.AddGroupToGroup).

object.AddPlayerToGroup(GroupId As Long, _
    playerId As Long) 

Parameters

object
Object expression that resolves to a DirectPlay4 object.
GroupId
ID of the group to be augmented.
playerId
ID of the player to be added to the group.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following values:

DPERR_CANTADDPLAYER
DPERR_CONNECTIONLOST
DPERR_INVALIDGROUP
DPERR_INVALIDPLAYER
DPERR_NOSESSIONS

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

Remarks

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

See Also

DirectPlay4.CreateGroup, DirectPlay4.DeletePlayerFromGroup