HRESULT CreateGroup(LPDPID lppidID,
LPSTR lpGroupFriendlyName, LPSTR lpGroupFormalName);
Creates a group of players for a session. A player ID representing the new group will be returned to the caller.
·Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_CANTADDPLAYER DPERR_INVALIDOBJECT
DPERR_INVALIDPARAMS DPERR_OUTOFMEMORY
lppidID
Address for the DPID that will hold the DirectPlay player ID.
lpGroupFriendlyName
Address for the zero-terminated string that contains the friendly name of the group.
lpGroupFormalName
Address for the zero-terminated string that contains the formal name of the group.
Messages sent to a player ID designating this group will be sent to all members of the group. The lpGroupFriendlyName and lpGroupFormalName parameters are provided for players' convenience only; they are not used internally and do not need to be unique. However, player IDs assigned by DirectPlay will always be unique within a session. Groups are recognized as players for the session player count; if you have a four player game with four existing players, calls to IDirectPlay::CreateGroup will fail. The state of the IDirectPlay::EnableNewPlayers method does not affect your application's ability to create groups.
Upon successful completion, this method sends a DPMSG_ADDPLAYER system message to all of the other players in the game announcing that a new group has been created.