Export (0) Print
Expand All

MTSCreateActivity function

[MTSCreateActivity is available for in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use the CoCreateActivity function.]

Creates an activity in a single-threaded apartment to do synchronous or asynchronous batch work.

Syntax


HRESULT __stdcall MTSCreateActivity(
  _In_   REFIID riid,
  _Out_  void **ppobj
);

Parameters

riid [in]

The ID of the interface to be returned by the ppObj parameter. This parameter should always be IID_IMTSActivity so that a pointer to IMTSActivity is returned.

ppobj [out]

A pointer to the interface of an activity object. The activity object is automatically created by the call to MTSCreateActivity.

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, and S_OK.

Remarks

MTSCreateActivity creates an activity object that is used to submit batch work to the COM+ system. The batch work that is submitted through MTSCreateActivity can be either synchronous or asynchronous and runs in a single-threaded apartment (STA).

MTSCreateActivity returns a pointer to the IMTSActivity interface of the object that is created by the call to MTSCreateActivity. By using the methods of IMTSActivity, you determine whether the batch work is done synchronously or asynchronously. The batch work itself is implemented through the IMTSCall interface.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

ComSvcs.h

Library

ComSvcs.lib

DLL

ComSvcs.dll

See also

CoCreateActivity

 

 

Community Additions

ADD
Show:
© 2014 Microsoft