?/TD>
Microsoft DirectX 9.0

IDirectPlay8Client::Close Method


Closes the open connection to a session and uninitializes the IDirectPlay8Client object. This method must be called on any object that is successfully initialized with a call to the IDirectPlay8Client::Initialize method.

Syntax

HRESULT Close(      

    const DWORD dwFlags );

Parameters

dwFlags
[in] The following flag can be specified.
DPNCLOSE_IMMEDIATE
Close immediately. Do not wait for outstanding calls to complete.

Return Value

Returns S_OK if successful, or the following error value.

DPNERR_UNINITIALIZEDThe requested object has not been initialized.


Remarks

Calling IDirectPlay8Client::Close will cancel all outstanding operations, including guaranteed messages that are in the queue waiting to be sent. Messages that have already been sent as guaranteed will continue to be retried until acknowledgement of their delivery has been received. To make sure all messages are sent, wait for all outstanding IDirectPlay8Client::Send calls to complete before calling IDirectPlay8Client::Close.

If you do not want the application to wait, the application should call IDirectPlay8Client::CancelAsyncOperation to cancel all outstanding sends prior to calling IDirectPlay8Client::Close or doing a final release call on the IDirectPlay8Client interface. Failing to do so causes unpredictable results.

Calling IDirectPlay8Client::Close will invalidate any DPN_CAPS, DPN_CAPS_EX, and DPN_SP_CAPS associated with the IDirectPlay8Client object.



© 2002 Microsoft Corporation. All rights reserved.