ScheduleTasks method
Defines a set of tasks to execute.
Syntax
HRESULT retVal = object.ScheduleTasks(TaskInfo, Events, TaskIDs, ulNumTasks, ulWaitPeriod);
Parameters
TaskInfo [in]
Type: DXTMTASKINFOArray of one or more DXTMTASKINFO structures that define the task to perform.
Events [in]
Type: HANDLEOptional array of event-object handles associated with each scheduled task.
TaskIDs [out]
Type: DWORDOptional array used to receive the ID of each scheduled task.
ulNumTasks [in]
Type: unsigned longNumber of tasks to schedule. This also defines the size of the arrays associated with the Events and TaskIDs parameters.
ulWaitPeriod [in]
Type: unsigned longNumber of milliseconds to wait for each scheduled task to complete.
Remarks
This method adds a set of tasks to a queue for asynchronous execution. All tasks are queued using the calling thread. If the calling thread must wait and has finished queuing the tasks, it will start to execute tasks in the queue until the queue is empty. This reduces the amount of necessary context switches.
As each task is scheduled, the associated event, as specified by the Events parameter, is reset. As each task completes, the associated event is signaled.
If a nonzero value is supplied for the ulWaitPeriod parameter, the Events array is required and must have a valid event-object handle in each entry. A value of INFINITE can be used.
Each assigned task can use an asynchronous procedure call (APC) or an event, but specifying both in the DXTMTASKINFO structure results in the function returning E_INVALIDARG once it attempts to execute that task.