IObjectContextInfo::GetTransaction method (comsvcs.h)

Retrieves a reference to the current transaction. You can use this reference to manually enlist a resource manager that does not support automatic transactions.

Syntax

HRESULT GetTransaction(
  [out] IUnknown **pptrans
);

Parameters

[out] pptrans

A reference to the IUnknown interface of the transaction that is currently executing. You can then QueryInterface to get the ITransaction interface for the current transaction.

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following values.

Return code Description
S_OK
The object is executing in a transaction.
S_FALSE
The object is not executing in a transaction. The pptrans parameter is NULL.

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 comsvcs.h

See also

IObjectContextInfo