Microsoft DirectX 8.1 (C++)

IMediaEvent::GetEvent

The GetEvent method retrieves the next event notification from the event queue.

Syntax

HRESULT GetEvent(
  long *lEventCode,
  long *lParam1,
  long *lParam2,
  long msTimeout
);

Parameters

IEventCode

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

lParam1

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

lParam2

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

msTimeout

[in] Time-out interval, in milliseconds. Use INFINITE to block until there is an event.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

Value Description
S_OK Success.
E_ABORT Timeout expired.

Remarks

If no event is on the queue, this method waits up to msTimeout milliseconds for an event to arrive. Avoid using a time-out interval of INFINITE, because threads cannot process any messages while waiting in GetEvent. If you call GetEvent from the same thread that processes Windows messages, specify only small wait times, in order to remain responsive to user input. This is most important when streaming data from a source such as the Internet, because state transitions can take significantly more time to complete.

After calling GetEvent, call the IMediaEvent::FreeEventParams method to release any resources allocated for the event parameters.

For a list of notification codes and event parameter values, see Event Notification Codes.

See Also