Microsoft DirectX 8.1 (C++) |
PFNDPNMESSAGEHANDLER is an application-defined callback function used by the IDirectPlay8Peer, IDirectPlay8Client, and IDirectPlay8Server IDirectPlay8LobbyClient and IDirectPlay8LobbiedApplication interfaces to process messages.
typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)( PVOID pvUserContext, DWORD dwMessageType, PVOID pMessage );
Additionally, if the application supports Microsoft® DirectPlay® lobby functionality, this parameter can specify one of the following message types that are generated by the IDirectPlay8LobbyClient and IDirectPlay8LobbiedApplication interfaces. Each interface uses a different subset of the available messages. Refer to the interface documentation for details.
See the documentation for the individual messages for appropriate return values. Unless otherwise noted, this function should return S_OK.
This function must be threadsafe because it might be called reentrantly through multiple threads.
Callback messages from the same player are serialized. Once you receive a message from a player, you will not receive another until you have handled the first message, and the callback function has returned.
The message structures have the same name as the message type except the "DPN_MSGID" is replaces with "DPNMSG". For example, the DPN_MSGID_CONNECTION_TERMINATED message type uses the DPNMSG_CONNECTION_TERMINATED message structure to convey the actual message information.
When implementing this callback function, first look at the message type returned in the dwMessageType parameter and then cast the message structure (pMessage) to that type to obtain message information. Some messages don't have a defined structure because they have no parameters. For these messages, the pMessage parameter is NULL.
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 Dplay8.h.