Microsoft DirectX 8.1 (Visual Basic)

DirectPlay8LobbyClient.ConnectApplication

Connects a lobby-enabled application to the session specified in the DPL_CONNECT_INFO type. If the application is not running, this method can be used to launch the application.

When the connection is successfully established, Microsoft® DirectPlay® calls the message handler's DirectPlay8LobbyEvent.Connect method.

ConnectApplication( _
    ConnectionInfo As DPL_CONNECT_INFO, 
    lTimeOut As Long, _
    lFlags As CONST_DPLCONNECT) As Long

Parts

ConnectionInfo
DPL_CONNECT_INFO type that describes the connection parameters, including the GUID of the application to connect to.
lTimeOut
Long value that specifies the number of milliseconds to wait for the connection to process.
lFlags
One of the constants of the CONST_DPLCONNECT enumeration that determines connection behavior.

Return Values

Returns a Long value that is set to the application connection handle . This handle is used for further communication with the application. Additionally, this handle is used in the Application parameter in the DirectPlay8LobbyClient.ReleaseApplication method.

Error Codes

If the method fails, Err.Number can be set to one of the following values.

DPNERR_CANTLAUNCHAPPLICATION
DPNERR_INVALIDFLAGS
DPNERR_INVALIDPARAM
DPNERR_TIMEDOUT