?/TD>
Microsoft DirectX 9.0

IDirectPlay8LobbyClient::ConnectApplication Method


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.

Syntax

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 Value

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

DPNERR_CANTLAUNCHAPPLICATIONThe lobby cannot launch the specified application.
DPNERR_INVALIDFLAGSThe flags passed to this method are invalid.
DPNERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DPNERR_TIMEDOUTThe operation could not complete because it has timed out.
DPNERR_NOCONNECTIONNo communication link was established.
DPNERR_DOESNOTEXISTRequested element is not part of the address.


Remarks

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



© 2002 Microsoft Corporation. All rights reserved.