MQBeginTransaction

The MQBeginTransaction function creates an internal MSMQ transaction object that can be used to send messages to a queue or read messages from a queue.

HRESULT APIENTRY MQBeginTransaction(
  Transaction **ppTransaction  
);
 

Parameters

ppTransaction
[out] Pointer to Transaction variable that points to the new transaction object.

Return Values

MQ_OK
Indicates success.
MQ_ERROR_INSUFFICIENT_RESOURCES
There are no resources to create a new transaction.

Remarks

The pointer returned by MQBeginTransaction can be used to set the pTransaction parameter of MQSendMessage or MQReceiveMessage.

For a description of internal transactions, see MSMQ Internal Transactions.

For an example of an internal transaction, see Sending Messages Using an Internal Transaction.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQReceiveMessage, MQSendMessage