IDirectPlay4::DestroyPlayer

IDirectPlay4 Interface

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.

Syntax

HRESULT DestroyPlayer(
  DPID idPlayer
  );

Parameters

idPlayer
Player ID of the locally owned player to be removed from the session. When DestroyPlayer is called by the host of the session, this DPID can be that of any player, local or remote.

Return Value

Returns DP_OK if successful, or one of the following error messages otherwise:
DPERR_ACCESSDENIED
DPERR_CONNECTIONLOST
DPERR_INVALIDOBJECT
DPERR_INVALIDPLAYER
DPERR_UNAVAILABLE

Remarks

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 cancelled.

See Also

IDirectPlay4::CreatePlayer, DPMSG_DESTROYPLAYERORGROUP


Top of Page Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.