##

IDirectPlay3::EnumGroupsInGroup

IDirectPlay3 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 IDirectPlay3::CreateGroupInGroup method or by adding them to a group with the IDirectPlay3::AddGroupToGroup method. This method is not recursive.

You can't use EnumGroupsInGroup in a lobby session you're not connected to.

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 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 IDirectPlay3::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 OR together 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_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 can't be used in lobby sessions.
  DPENUMGROUPS_SHORTCUT
    Enumerates groups that are shortcuts added to the group using IDirectPlay3::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

Returns DP_OK if successful, or one of the following error messages otherwise:

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

IDirectPlay3::CreateGroupInGroup, IDirectPlay3::DestroyGroup, IDirectPlay3::AddGroupToGroup, IDirectPlay3::DeleteGroupFromGroup

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.