Microsoft DirectX 8.1 (C++) |
When the user has selected an application and your lobby client has verified that it has been registered on the user's system, you can launch the application. To do so, call IDirectPlay8LobbyClient::ConnectApplication. The first parameter is a DPL_CONNECT_INFO structure that contains a variety of information needed to launch the application including the following:
When you call ConnectApplication, you can set a connection context value in the pvUserApplicationContext parameter. If you do not set the connection context value when you call ConnectApplication, you can set the pvConnectionContext parameter when you handle the DPL_MSGID_CONNECT message. After this value has been set, the connection context value will be passed along in the pvConnectionContext parameter with any message you receive from that connection. This is a useful parameter to set if you are receiving messages from multiple connections and using a common lobby client message handler.
The IDirectPlay8LobbyClient::ConnectApplication method returns an application handle that is used to identify the application in all further communication. Once the application has launched and the connection successfully established, your message handler receives a DPL_MESSAGE_CONNECT message.
Note Your message handler may receive the DPL_MESSAGE_CONNECT before the IDirectPlay8LobbyClient::ConnectApplication method has confirmed the connection by returning a success code. Your message handler should be prepared to handle the message even if the method has not yet returned.