IDirectPlay4::CancelMessage

IDirectPlay4 Interface

Used to cancel a specific message (or all the messages) that are still in the send queue. CancelMessage applies only to asynchronous messages.

In order to cancel a specific message, the application must obtain and save the message ID returned by the IDirectPlay4::SendEx method.

Messages that have left the message queue and are partially sent cannot be canceled. A message sent to a group cannot be canceled after it has been sent to at least one member of the group.

Canceling a message still generates a DPMSG_SENDCOMPLETE system message indicating the message was canceled.

Syntax

HRESULT CancelMessage(
  DWORD dwMsgID,
  DWORD dwFlags
  );

Parameters

dwMsgID
ID of the specific message to be canceled. This ID is returned when the message is sent using IDirectPlay4::SendEx. Specify zero to cancel all messages.
dwFlags
This parameter is reserved. Must be zero.

Return Value

Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_CANCELFAILED
DPERR_INVALIDFLAGS
DPERR_INVALIDPARAMS
DPERR_UNKNOWNMESSAGE
DPERR_UNSUPPORTED

This method returns DPERR_CANCELFAILED if the message cannot be canceled. This method returns DPERR_UNKNOWNMESSAGE if the ID of the message to be canceled is invalid. It returns DP_OK if there are no messages in the send queue.

Remarks

If the DirectPlay Protocol was specified in the session description, then all the options on CancelMessage are available. Otherwise, an application should call GetCaps to determine what options the service provider has implemented.

See Also

IDirectPlay4::SendEx, IDirectPlay4::Send, IDirectPlay4::GetMessageQueue, DPMSG_SENDCOMPLETE, IDirectPlay4::CancelPriority


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