IDirectPlay4::EnumGroupsInGroup

IDirectPlay4 Interface

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

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

Syntax

HRESULT EnumGroupsInGroup(
  DPID idGroup,
  LPGUID lpguidInstance,
  LPDPENUMPLAYERSCALLBACK2 lpEnumCallback,
  LPVOID lpContext,
  DWORD dwFlags
  );

Parameters

idGroup
DPID of the group whose subgroups are to be enumerated.
lpguidInstance
Pointer to a globally unique identifier (GUID) identifying the session to be enumerated. This parameter is ignored unless the DPENUMPLAYERS_SESSION flag is specified. The GUID must equal one of the sessions enumerated by the IDirectPlay4::EnumSessions method.
lpEnumCallback
Pointer to the EnumPlayersCallback2 function that will be called for every group in the group that matches the criteria specified in dwFlags.
lpContext
Pointer to an application-defined context that is passed to each enumeration callback.
dwFlags
Flags specifying how the enumeration will be done. The default (dwFlags = 0) enumerates all groups in the current active session. You should use a logical OR operation to combine the flags that you want to specify. Only groups that meet all the criteria of the combined flags will be enumerated. For example, if you specify (DPENUMGROUPS_LOCAL | DPENUMGROUPS_STAGINGAREA) only groups that are local and are staging areas will be enumerated. If you specify (DPENUMGROUPS_LOCAL | 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:
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 lpguidInstance 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 IDirectPlay4::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 Value

Returns DP_OK if successful, or one of the following error messages otherwise:
DPERR_CONNECTIONLOST
DPERR_INVALIDFLAGS
DPERR_INVALIDGROUP
DPERR_INVALIDPARAMS
DPERR_NOSESSIONS
DPERR_UNSUPPORTED

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

See Also

IDirectPlay4::CreateGroupInGroup, IDirectPlay4::DestroyGroup, IDirectPlay4::AddGroupToGroup, IDirectPlay4::DeleteGroupFromGroup


Top of Page Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.