[[This API may be altered or unavailable in subsequent versions of the operating system or product. Please use the Task Scheduler 2.0 Interfaces instead.] ]
Retrieves the next specified number of tasks in the enumeration sequence.
If there are fewer than the requested number of tasks left in the sequence, all the remaining elements are retrieved.
HRESULT Next( ULONG celt, LPWSTR **rgpwszNames, ULONG *pceltFetched );
The number of tasks to retrieve.
A pointer to an array of pointers (LPWSTR) to null-terminated character strings containing the file names of the tasks returned from the enumeration sequence. These file names are taken from the Scheduled Tasks folder and have the ".job" extension.
After processing the names returned in rgpwszNames, you must first free each character string in the array and then the array itself using CoTaskMemFree.
A pointer to the number of tasks returned in rgpwszNames. If the celt parameter is 1, this parameter may be NULL.
Returns one of the following values.
||The number of tasks retrieved equals the number requested.|
||The number returned is less than the number requested. (Thus, there are no more tasks to enumerate.)|
||A parameter is invalid.|
||Not enough memory is available.|
The IEnumWorkItems interface also provides methods for resetting the enumeration, skipping tasks, and making a copy of the current state of the enumeration.
For an example of how to use Next to enumerate the tasks in the Scheduled Tasks folder, see Enumerating Tasks Example.
|Windows version||Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]|