Microsoft DirectX 8.1 (C++)

IMediaEvent.WaitForCompletion

The WaitForCompletion method waits for the filter graph to render all available data.

Syntax

objMediaEvent.WaitForCompletion(
    msTimeout As Long,
    ByRef EvCode As Long)

Parameters

msTimeout

Time-out interval, in milliseconds, or -1 to block indefinitely. 

EvCode

Variable that receives an event code, or zero if the time-out expires.

Return Values

This method does not return a value.

Remarks

This method blocks until the time-out expires, or one of the following events occurs:

During the wait, the method discards all other event notifications.

The filter graph must be running or the method fails. If the time-out expires, the method raises run-time error 287, and sets EvCode to zero.

Example Code

The following example uses a time-out of zero:

On Error Resume Next
Dim EvCode As Long
iEvent.WaitForCompletion 0, EvCode  'Return immediately
If EventCode <> 0 Then
    ' Playback has stopped.
End If

See Also