DirectX SDK |
The IDirectPlay4::EnumGroupPlayers method enumerates the players belonging to a specific group in the currently open session. If there is no open session, players in a remote session can be enumerated by specifying the DPENUMPLAYERS_SESSION flag and the guidInstance of the session. Password-protected remote sessions cannot be enumerated.
A pointer to an application-implemented callback function must be supplied, and DirectPlay calls it once for each player in the group that matches the criteria specified in dwFlags.
You cannot use EnumGroupPlayers in a lobby session you are not connected to.
HRESULT EnumGroupPlayers( DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags );
Can be one or more of the following values:
Returns DP_OK if successful, or one of the following error messages otherwise:
DPERR_ACCESSDENIED |
DPERR_CONNECTIONLOST |
DPERR_INVALIDPARAMS |
DPERR_INVALIDGROUP |
DPERR_NOSESSIONS |
DPERR_UNAVAILABLE |
This method returns DPERR_ACCESSDENIED if the session is a lobby session you are not connected to. It returns DPERR_INVALIDPARAMS if an invalid callback, an invalid guidInstance, or if invalid flags were supplied. It returns DPERR_NOSESSIONS if there is no active session. It returns DPERR_UNAVAILABLE if the session could not be enumerated.
By default, this method will enumerate all players in the current session. The DPENUMPLAYERS_SESSION flag can be used, along with a session instance GUID, to request that a session's host provide its list for enumeration. Use of the DPENUMPLAYERS_SESSION flag with this method must occur after the IDirectPlay4::EnumSessions method has been called, and before any calls to the IDirectPlay4::Close or IDirectPlay4::Open methods.
The DPENUMPLAYERS_OWNER flag is returned in the callback, indicating which player is the owner of the group.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dplay.h.
Import Library: Use dplayx.lib.
IDirectPlay4::CreatePlayer, IDirectPlay4::DestroyPlayer, IDirectPlay4::AddPlayerToGroup, IDirectPlay4::DeletePlayerFromGroup