Share via


MSMQMessage.IsFirstInTransaction

 

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

(Introduced in MSMQ 2.0.) The IsFirstInTransaction property of the MSMQMessage object indicates whether the message was the first message sent in its transaction.

This property is superseded by MSMQMessage.IsFirstInTransaction2 in MSMQ 3.0.

Data type: Short
Run-time access: Read-only
Property IsFirstInTransaction As Short  

Property Value

A Short set to one of the following values:

1

The message was the first message sent in the transaction.

0

The message was not the first message sent in the transaction.

Remarks

This property is available for MSMQ 2.0 and later. It is used by receiving applications to verify that a message was the first message sent in a single transaction to a single queue.

You can use IsFirstInTransaction along with two other properties to verify transaction boundaries. These two properties are a property for checking whether a message was the last message sent in a transaction and a property for retrieving the identifier of the transaction: MSMQMessage.IsLastInTransaction and MSMQMessage.TransactionId.

If only one message is sent in a transaction, both IsFirstInTransaction and MSMQMessage.IsLastInTransaction are set.

In C++ COM applications, you must use a smart pointer to the IMSMQMessage2 or IMSMQMessage3 interface to expose the IsFirstInTransaction property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_FIRST_IN_XACT.

For information on See
How transaction boundaries can be used Checking for Transaction Boundaries when Receiving Messages
Checking the last message in the transaction MSMQMessage.IsLastInTransaction
Retrieving the identifier of the transaction MSMQMessage.TransactionId

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib

See Also

MSMQMessage
MSMQMessage.IsLastInTransaction
MSMQMessage.TransactionId
PROPID_M_FIRST_IN_XACT