Platform SDK: DirectX

DirectPlay4.GetDPEnumGroupsInGroup

The DirectPlay4.GetDPEnumGroupsInGroup method enumerates all groups and shortcuts to groups that are contained within another group. Groups are placed inside other groups by creating them with the DirectPlay4.CreateGroupInGroup method or by adding them to a group with the DirectPlay4.AddGroupToGroup method. This method is not recursive.

object.GetDPEnumGroupsInGroup(GroupId As Long, _
    sessionGuid As String, _
    flags As CONST_DPENUMGROUPFLAGS) _
    As DirectPlayEnumPlayers

Parameters

object
Object expression that resolves to a DirectPlay4 object.
GroupId
ID of the group whose subgroups are to be enumerated.
sessionGuid
Globally unique identifier (GUID) of the session to be enumerated. This parameter is ignored unless the DPENUMPLAYERS_SESSION flag is specified. The GUID must belong to one of the sessions enumerated by the DirectPlay4.GetDPEnumSessions method.
flags
Flags specifying how the enumeration will be done. By default (flags = 0), the method enumerates all groups in the current active session. Only groups that meet all the criteria of the combined flags will be enumerated. For example, if you specify (DPENUMGROUPS_LOCAL Or DPENUMGROUPS_STAGINGAREA) only groups that are local and are staging areas will be enumerated. If you specify (DPENUMGROUPS_LOCAL Or DPENUMGROUPS_REMOTE), no groups will be enumerated, because no group can be both local and remote.

Can be one or more of the following values from the CONST_DPENUMGROUPFLAGS enumeration:

DPENUMGROUPS_ALL
Enumerates all groups in the group.
DPENUMGROUPS_HIDDEN
Enumerates only the currently available hidden groups in the group.
DPENUMGROUPS_LOCAL
Enumerates groups in the group created locally by this DirectPlay object.
DPENUMGROUPS_REMOTE
Enumerates groups in the group created by remote DirectPlay objects.
DPENUMGROUPS_SESSION
Performs enumeration in the session identified by the sessionGuid parameter. This flag can only be used if there is no current active session. This flag cannot be used in lobby sessions.
DPENUMGROUPS_SHORTCUT
Enumerates groups that are shortcuts added to the group using DirectPlay4.AddGroupToGroup. (A shortcut is a link to another group.)
DPENUMGROUPS_STAGINGAREA
Enumerates groups in the group that are staging areas. (Staging areas are used to marshal players together in order to launch a new session.)

Return Values

If the method succeeds, it returns a DirectPlayEnumPlayers object.

Error Codes

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

DPERR_CONNECTIONLOST
DPERR_INVALIDFLAGS
DPERR_INVALIDGROUP
DPERR_INVALIDPARAMS
DPERR_NOSESSIONS
DPERR_UNSUPPORTED

This method returns DPERR_INVALIDPARAMS if an invalid sessionGuid is supplied. It returns DPERR_NOSESSIONS if there is no active session. It returns DPERR_UNSUPPORTED if the session could not be enumerated.

Remarks

You cannot use this method in a lobby session you are not connected to.

See Also

DirectPlay4.DeleteGroupFromGroup, DirectPlay4.DestroyGroup, Using GUIDs