?/TD>
Microsoft DirectX 9.0

IDirectPlayVoiceClient::Disconnect Method


Disconnects the Microsoft?DirectPlay?Voice client from the existing DirectPlay Voice session.

Syntax

HRESULT Disconnect(      

    DWORD dwFlags );

Parameters

dwFlags
[in] Flag. You can specify the following flag.
DVFLAGS_SYNC
Do not return until the operation is completed.

Return Value

Returns DV_OK if successful, or one of the following error values.

DVERR_ALREADYPENDINGAn asynchronous call of this type is already pending.
DVERR_CONNECTABORTINGThe connection is being disconnected.
DVERR_INVALIDFLAGSThe flags passed to this method are invalid.
DVERR_INVALIDPARAMOne or more of the parameters passed to the method are invalid.
DVERR_NOTCONNECTEDThe DirectPlay Voice object is not connected.
DVERR_NOTINITIALIZEDThe IDirectPlayVoiceClient::Initialize or IDirectPlayVoiceServer::Initialize method must be called before calling this method.
DVERR_PENDINGNot an error, this return indicates that an asynchronous operation has reached the point where it is successfully queued.
DVERR_SESSIONLOSTThe transport has lost the connection to the session.
DVERR_TIMEOUTThe operation could not be performed in the specified time.


Remarks

On calling this method, all recording and playback is stopped. If a connection is being processed, it is canceled by this call.

Unless the DVFLAGS_SYNC is specified, calling this method immediately returns a DVERR_PENDING error value and proceeds to process the disconnection request in the background. The status of the disconnection is not known until the DirectPlay Voice client generates a DVMSGID_DISCONNECTRESULT message that contains the disconnection result. Only one disconnection can be pending at a time. If you call IDirectPlayVoiceClient::Disconnect while a disconnect is pending, DirectPlay will return a DVERR_ALREADYPENDING error value.

If this method is called synchronously by setting the DVFLAGS_SYNC flag, the method does not return until the IDirectPlayVoiceClient::Disconnect method completes. The result of the disconnection is the return value from this method. No DVMSGID_DISCONNECTRESULT message is generated.



© 2002 Microsoft Corporation. All rights reserved.