Communicating with DirectPlay Objects |
DirectPlay essentially consists of a collection of Component Object Model (COM) objects. Each object exposes one or more interfaces that enable you to control various aspects of DirectPlay. For instance, the DirectPlay Peer object is used to manage peer-to-peer games.
You communicate with a DirectPlay object by calling the methods exposed by its interfaces. For instance, to send some data to another user in a peer-to-peer game, you would send a message by calling the SendTo method. DirectPlay then takes care of getting the message to its target.
DirectPlay communicates with your application through one or more callback functions. Your application implements the callback function and passes a pointer to the function to DirectPlay during initialization. When DirectPlay needs to communicate with your application, it calls the callback function and passes in two key items of information:
Because much of DirectPlay messaging is multithreaded, it is critical that callback functions be properly implemented.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center