DirectX SDK

DirectPlay4.CreateGroupInGroup

The DirectPlay4.CreateGroupInGroup method creates a group within an existing group. A group created within another group can be enumerated only by using the DirectPlay4.GetDPEnumGroupsInGroup method. A group created this way can be destroyed by calling the DirectPlay4.DestroyGroup method.

object.CreateGroupInGroup(parentid As Long,
  friendlyName As String,
  formalName As String,
  flags As CONST_DPGROUPFLAGS) As Long

Parameters

object
Object expression that resolves to a DirectPlay4 object.
parentid
DirectPlay ID of the existing group within which a group will be created.
friendlyName
Handle that can be used to identify and access the created group. This token identifier should differ from formalName.
formalName
Handle that can be used to identify and access the created group. This token identifier should differ from friendlyName.
flags
Flag from the CONST_FLAGS enumeration indicating what type of group to create. Can be DPGROUP_LOCAL or DPGROUP_STAGINGAREA. If DPGROUP_LOCAL is not set, the group is a remote group.

Return Values

Returns the created group's DirectPlay ID.

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_INVALIDFLAGS
DPERR_INVALIDGROUP
DPERR_INVALIDPARAMS

This method returns DPERR_CANTADDPLAYER if the group could not be created. It returns DPERR_INVALIDGROUP if the parent group ID is invalid.

Remarks

If the group is created in a client/server session, no group notification messages are sent. Groups are only visible on the computer that created them, regardless of whether the computer is the client or the host.

If the group is created in a peer-to-peer session, CreateGroupInGroup will generate a DPSYS_CREATEPLAYERORGROUP system message generated to inform players of this change.

If you destroy a top-level group, any member groups it contains are destroyed as well, and the appropriate destruction messages are sent.