MFScheduleWorkItemEx function (mfapi.h)

Schedules an asynchronous operation to be completed after a specified interval.

Syntax

HRESULT MFScheduleWorkItemEx(
  IMFAsyncResult *pResult,
  INT64          Timeout,
  MFWORKITEM_KEY *pKey
);

Parameters

pResult

Pointer to the IMFAsyncResult interface of an asynchronous result object. To create the result object, call MFCreateAsyncResult.

Timeout

Time-out interval, in milliseconds. Set this parameter to a negative value. The callback is invoked after −Timeout milliseconds. For example, if Timeout is −5000, the callback is invoked after 5000 milliseconds.

pKey

Receives a key that can be used to cancel the timer. To cancel the timer, call MFCancelWorkItem and pass this key in the Key parameter.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The function succeeded.

Remarks

When the timer interval elapses, the timer calls MFInvokeCallback with the pResult pointer to invoke the asynchronous callback. The callback is specified when you create the result object.

Requirements

   
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

MFScheduleWorkItem

Media Foundation Functions

Work Queues