| DirectX SDK | 
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) 
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.
A DPSYS_ADDPLAYERTOGROUP system message will be generated and sent to all the other players.