Platform SDK: DirectX |
The DirectPlay4.GetDPEnumConnections method enumerates all the registered service providers and lobby providers available to the application. Typically these are presented to the user to make a selection, and the selected connection is passed to the DirectPlay4.InitializeConnection method.
object.GetDPEnumConnections(guid As String, _ flags As CONST_DPENUMCONNECTIONFLAGS) _ As DirectPlayEnumConnections
If it succeeds, the method returns a DirectPlayEnumConnections object.
If the method fails, an error is raised and Err.Number may be set to one of the following values:
DPERR_CONNECTIONLOST |
DPERR_INVALIDFLAGS |
DPERR_INVALIDPARAMS |
The order in which the service and lobby providers are returned is not guaranteed to be the same in subsequent calls to GetDPEnumConnections.
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 DirectPlay4.InitializeConnection method on each connection and check for an error code to determine whether the service provider can be used.
Some service providers can register themselves as private. These service providers are not enumerated by this method. To use private service providers, you must explicitly reference them by GUID, either by launching the application from a lobby or by creating a DirectPlay address and passing it to InitializeConnection.