Microsoft DirectX 8.1 (C++)

IMediaEvent::GetEventHandle

The GetEventHandle method retrieves a handle to a manual-reset event that remains signaled while the queue contains event notifications.

Syntax

HRESULT GetEventHandle(
  OAEVENT *hEvent
);

Parameters

hEvent

[out] Pointer to a variable that receives the event handle.

Return Value

Returns S_OK.

Remarks

The Filter Graph Manager keeps a manual-reset event that reflects the state of the event queue. If the queue contains event notifications, the manual-reset event is signaled. If the queue is empty, the IMediaEvent::GetEvent method resets the event.

An application can use this event to determine the state of the queue. First call GetEventHandle to obtain a handle to the event. Wait for the event to be signaled, using a Microsoft® Windows® function such as WaitForSingleObject. When the event is signaled, call the IMediaEvent::GetEvent method to retrieve the next event notification from the queue. The Filter Graph Manager keeps the event signaled until the queue is empty; then it resets the event.

For Automation compatibility, this method takes a pointer to an OAEVENT variable. In C++, declare a variable of type HANDLE and cast it to type OAEVENT, as follows:

HANDLE hEvent;
GetEventHandle( (OAEVENT*) &hEvent );

Another way for applications to monitor the event queue is by calling the IMediaEventEx::SetNotifyWindow method.

See Also