Platform SDK: DirectX |
The DirectPlay4.InitializeConnection method initializes a DirectPlay connection. All the information about the connection, including the service provider to use, the network address of the server, and the GUID of the session, is passed in through the addr parameter.
object.InitializeConnection(addr As DirectPlayAddress)
If the method fails, an error is raised and Err.Number may be set to one of the following values:
DPERR_ALREADYINITIALIZED |
DPERR_INVALIDFLAGS |
DPERR_INVALIDPARAMS |
DPERR_UNAVAILABLE |
This method returns DPERR_ALREADYINITIALIZED if InitializeConnection has previously been called on this object. It returns DPERR_UNAVAILABLE if the service provider could not be initialized. This can be because the resources necessary to operate this service provider are not present (for example, TCP/IP stack not present).
The addr parameter supplied to this method can be obtained from the DirectPlay4.GetDPEnumConnections method, or the application can create one directly by using one of the address creation methods of DirectPlayLobby3.
This method loads and initializes the appropriate service provider. The addr parameter is passed on to the service provider, which extracts and saves any relevant information. This information is used when the DirectPlay4.GetDPEnumSessions or DirectPlay4.Open method is called so that the service provider does not display a dialog box asking for that information.