Platform SDK: DirectX |
The IDirectPlay4::DestroyPlayer method deletes a local player from the session, removes any pending messages destined for that player from the message queue, and removes the player from any groups to which the player belonged. The player ID will not be reused during the current session.
In general, only the application that created the player can destroy the player. However, the host of the session can also destroy the player.
HRESULT DestroyPlayer( DPID idPlayer );
Returns DP_OK if successful, or one of the following error messages otherwise:
DPERR_ACCESSDENIED |
DPERR_CONNECTIONLOST |
DPERR_INVALIDOBJECT |
DPERR_INVALIDPLAYER |
DPERR_UNAVAILABLE |
This method generates a DPMSG_DELETEPLAYERFROMGROUP system message for each group that the player belongs to and then generates a DPMSG_DESTROYPLAYERORGROUP system message.
A player cannot be destroyed if the player has pending asynchronous messages in the send queue. All messages must either be completed or canceled.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dplay.h.
Import Library: Use dplayx.lib.