ITaskScheduler::Activate method (mstask.h)

[[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.] ]

The Activate method returns an active interface for a specified work item.

Syntax

HRESULT Activate(
  [in]  LPCWSTR  pwszName,
  [in]  REFIID   riid,
  [out] IUnknown **ppUnk
);

Parameters

[in] pwszName

A null-terminated string that specifies the name of the work item to activate.

[in] riid

An identifier that identifies the interface being requested. The only interface supported at this time, ITask, has the identifier IID_ITask.

[out] ppUnk

A pointer to an interface pointer that receives the address of the requested interface.

Return value

When this method succeeds, S_OK is returned.

If the method fails, one of the following error codes may be returned.

Return code Description
COR_E_FILENOTFOUND
The task does not exist.
E_INVALIDARG
The pwszName parameter is not valid.
E_OUTOFMEMORY
A memory allocation failed.
SCHED_E_UNKNOWN_OBJECT_VERSION
The task object version is either unsupported or invalid.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mstask.h
Library Mstask.lib
DLL Mstask.dll
Redistributable Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95

See also

ITask

ITaskScheduler