DirectX SDK

DirectPlay4.GetDPEnumGroups

The DirectPlay4.GetDPEnumGroups method enumerates all the top-level groups in the current session. Top-level groups are groups that were created by using the DirectPlay4.CreateGroup method.

object.GetDPEnumGroups(sessionGuid As String, _
    flags As CONST_DPENUMGROUPFLAGS) _
    As DirectPlayEnumPlayers

Parameters

object
Object expression that resolves to a DirectPlay4 object.
sessionGuid
Globally unique identifier (GUID) identifying the session to be enumerated. This parameter should be "" to enumerate groups in the currently open session. Otherwise the GUID must be equal to one of the sessions enumerated by DirectPlay4.GetDPEnumSessions. This parameter is ignored unless the DPENUMGROUPS_SESSION flag is specified.
flags
Flags specifying how the enumeration is to 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 this session.
DPENUMGROUPS_LOCAL
Enumerates groups created locally by this DirectPlay object.
DPENUMGROUPS_REMOTE
Enumerates groups 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. You cannot use this flag in a lobby session.
DPENUMGROUPS_STAGINGAREA
Enumerates groups that are in staging areas. (Staging areas are used to marshal players together in order to launch a new session.)

Return Values

If it succeeds, the method 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_INVALIDPARAMS
DPERR_NOSESSIONS
DPERR_UNAVAILABLE

This method returns DPERR_INVALIDPARAMS if an invalid sessionGuid or invalid flags were supplied. It returns DPERR_NOSESSIONS if there is no open session. It returns DPERR_UNAVAILABLE if the remote session could not be enumerated.

Remarks

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

If there is no open session, groups in a remote session can be enumerated by specifying the DPENUMGROUPS_SESSION flag and the sessionGuid of the session. Password-protected remote sessions cannot be enumerated.

To enumerate the subgroups in a group, use DirectPlay4.GetDPEnumGroupsInGroup.

See Also

DirectPlay4.DestroyGroup, DirectPlay4.GetDPEnumSessions, Using GUIDs