Index Topic Contents | |||
Previous Topic: IDirectPlay3::DestroyPlayer Next Topic: IDirectPlay3::EnumGroupPlayers |
IDirectPlay3::EnumConnections
IDirectPlay3 InterfaceEnumerates all the registered service providers and lobby providers that are available to the application. These should be presented to the user to make a selection. The connection that the user selects should be passed to the IDirectPlay3::InitializeConnection method.
HRESULT EnumConnections(
LPCGUID lpguidApplication,
LPDPENUMCONNECTIONSCALLBACK lpEnumCallback,
LPVOID lpContext,
DWORD dwFlags
);Parameters
- lpguidApplication
- Pointer to an application GUID. Only service providers and lobby providers that are usable by this application will be returned. If set to a NULL pointer, a list of all the connections is enumerated regardless of the application GUID.
- lpEnumCallback
- Pointer to a user-supplied EnumConnectionsCallback function that will be called for each available connection.
- lpContext
- Pointer to a user-defined context that is passed to the callback function.
- dwFlags
- Flags that specify the type of connections to be enumerated. The default (dwFlags = 0) will enumerate DirectPlay service providers only. Possible values are:
- DPCONNECTION_DIRECTPLAY enumerate DirectPlay service providers to communicate in an application session.
- DPCONNECTION_DIRECTPLAYLOBBY enumerate DirectPlay lobby providers to communicate with a lobby server.
Return Values
Returns DP_OK if successful, or one of the following error values otherwise:
- DPERR_INVALIDFLAGS
- DPERR_INVALIDPARAMS
Remarks
This method replaces the DirectPlayEnumerate function. DirectPlayEnumerate still works, but only returns registered service providers.
The order in which the service and lobby providers are returned is not guaranteed to be the same in subsequent calls to EnumConnections
Not all the enumerated connections are available for use. For example, this method will return the Modem service provider even if the user has no modem installed. The application can call the IDirectPlay3::InitializeConnection method on each connection and check for an error code to determine if the service provider can be used.
See Also
IDirectPlay3::InitializeConnection, EnumConnectionsCallback, DirectPlay Address
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.