Microsoft DirectX 8.1 (C++)

IDirectPlay8LobbyClient::ConnectApplication

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

When the connection is successfully established, the lobbied application generates a DPL_MSGID_CONNECT system message to the message handler.

HRESULT ConnectApplication(
DPL_CONNECT_INFO *const pdplConnectionInfo,
const PVOID pvUserApplicationContext,
DPNHANDLE *const phApplication,
const DWORD dwTimeOut,
const DWORD dwFlags
);

Parameters

pdplConnectionInfo
[in] Pointer to a DPL_CONNECT_INFO structure, which describes the connection parameters, including the globally unique identifier (GUID) of the application to connect to.
pvUserApplicationContext
[in] Pointer to a context value, defined for the lobby client, that is passed in calls to the lobby client's message handler.
phApplication
[out] Pointer to a DPNHANDLE that specifies the application connect handle that is set if this method succeeds. This handle is used for further communication with the application. Additionally, this handle is used in the phApplication parameter in the IDirectPlay8LobbyClient::ReleaseApplication method.
dwTimeOut
[in] Variable of type DWORD that specifies the number of milliseconds to wait for the connection to process.
dwFlags
[in] Reserved. Must be 0.

Return Values

Returns S_OK if successful, or one of the following error values.

DPNERR_CANTLAUNCHAPPLICATION
DPNERR_INVALIDFLAGS
DPNERR_INVALIDPARAM
DPNERR_TIMEDOUT
DPNERR_NOCONNECTION
DPNERR_DOESNOTEXIST

Remarks

When this method returns DPNERR_NOCONNECTION, the reason is usually that the application described in the pdplConnectionInfo parameter has not called IDirectPlay8LobbiedApplication::SetAppAvailable.

Requirements

  Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
  Windows 98/Me: Available as a redistributable for Windows 98 and later.
  Header: Declared in Dplobby8.h.