Platform SDK: DirectX

DirectPlay4.GetDPEnumConnections

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

Parameters

object
Object expression that resolves to a DirectPlay4 object.
guid
Globally unique identifier for the application. Only service providers and lobby providers that are usable by this application will be returned. If set to "", a list of all the connections is enumerated regardless of the application GUID.
flags
CONST_DPENUMCONNECTIONFLAGS flags that specify the type of connections to be enumerated. The default (flags = 0) gives the same results as DPCONNECTION_DIRECTPLAY.

Return Values

If it succeeds, the method returns a DirectPlayEnumConnections object.

Error Codes

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

Remarks

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.

See Also

Using GUIDs