Share via


ITransactionVoterFactory2::Create

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

This method creates the transaction voter object and exchanges the ITransactionVoterNotifyAsync2 and ITransactionVoterBallotAsync2 sinks between the transaction voter and the DTC proxy.

Syntax

  
HRESULT Create(   ITransaction * pITransaction,  ITransactionVoterNotifyAsync2 * pVoterNotify,  ITransactionVoterBallotAsync2 ** ppVoterBallot);  

Parameters

pITransaction
[in] Pointer to the ITransaction interface associated with the transaction object on which the transaction voter enlists.

pVoterNotify
[in] Pointer to the ITransactionVoterNotifyAsync2 sink exported by the transaction voter.

ppVoterBallot
[out] Pointer to a pointer of an ITransactionVoterBallotAsync2 interface supplied to vote on the outcome of a distributed transaction with which it is associated.

Return Values

S_OK
Success.

E_INVALIDARG
Invalid arguments.

E_OUTOFMEMORY
Unable to allocate memory.

XACT_E_NOTRANSACTION
No transaction corresponding to pITransaction.

XACT_E_TMNOTAVAILABLE
Unable to connect to the transaction manager.

XACT_E_CONNECTION_DOWN
Connection with the transaction manager was lost.

XACT_E_CONNECTION_DENIED
The transaction manager refused to accept a connection.

E_UNEXPECTED
An unexpected error has occurred.

Remarks

A transaction voter calls this method on the transaction object for any transaction for which it needs notification of outcome events or would like to veto. The lifetime of a transaction voter object matches that of the transaction with which it is employed.

Requirements

For an explanation of the requirement values, see Requirements (Component Services).

Platforms: Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista

Header: Declared in txdtc.h