Export (0) Print
Expand All

IActionCollection::Create method

Creates and adds a new action to the collection.

Syntax


HRESULT Create(
  [in]   TASK_ACTION_TYPE type,
  [out]  IAction **ppAction
);

Parameters

type [in]

This parameter is set to one of the following TASK_ACTION_TYPE enumeration constants.

ValueMeaning
TASK_ACTION_EXEC
0

The action performs a command-line operation. For example, the action could run a script, start an executable, or, if the name of a document is provided, find its associated application and start the application with the document.

TASK_ACTION_COM_HANDLER
5

The action fires a handler.

TASK_ACTION_SEND_EMAIL
6

This action sends an email message.

TASK_ACTION_SHOW_MESSAGE
7

This action shows a message box.

 

ppAction [out]

An IAction interface that represents the new action.

Pass in a reference to a NULL IAction interface pointer. Referencing a non-NULL pointer can cause a memory leak because the pointer will be overwritten.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

You cannot add more than 32 actions to the collection.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Taskschd.h

Library

Taskschd.lib

DLL

Taskschd.dll

See also

TASK_ACTION_TYPE
IActionCollection
Task Scheduler
IAction
IExecAction
IEmailAction
IShowMessageAction
IComHandlerAction

 

 

Community Additions

ADD
Show:
© 2014 Microsoft