Microsoft DirectX 8.1 (C++)

Initiating a Peer-to-Peer Session

A peer-to-peer game can be launched directly by the user, or lobby-launched by a lobby client application that resides on the user's computer. This documentation will assume that the game is lobbyable, and can communicate with the lobby client.

One of the first steps you should take is to determine whether your game was lobby-launched. To do so, create and initialize a lobbied application object (CLSID_DirectPlay8LobbiedApplication). When you do so, you pass the object a pointer to your lobbied application message handler. This message handler receives messages directly from the lobbied application object, and indirectly from the lobby client and the lobby.

You should also create and initialize a peer object (CLSID_DirectPlay8Peer). This object will be your primary means of communicating with Microsoft® DirectPlay® , and the other users in the session. If you want to have multiple players in the session, you must create a separate instance of this object for each player.