Windows Dev Center

Expand Minimize


(Read-only, introduced in MSMQ 2.0.) The PROPID_M_FIRST_IN_XACT property indicates whether the message was the first message sent in a transaction.

Property ID


Type Indicator




Property Value

One of the following:


The message was the first message sent in the transaction.


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


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 PROPID_M_FIRST_IN_XACT along with two other properties to verify transaction boundaries. The PROPID_M_LAST_IN_XACT property is used for identifying the last message sent in the transaction, and the PROPID_M_XACTID property is used for retrieving the identifier of the transaction.

If only one message is sent in a transaction, both PROPID_M_FIRST_XACT and PROPID_M_LAST_XACT are set.

To retrieve this property, include PROPID_M_FIRST_IN_XACT in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and test the returned value. When retrieving this property, the type indicator can be set to VT_UI1 or VT_NULL. If you set the type indicator to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI1 during the function call.

Equivalent COM Property

With COM components, the equivalent property for ascertaining whether a message is the first message in a transaction is MSMQMessage.IsFirstInTransactionansaction.

For information on See

How transaction boundaries can be used

Checking for Transaction Boundaries when Receiving Messages

Identifying the last message in the transaction


Retrieving the identifier of the transaction


Example Code

The following code fragment shows how PROPID_M_FIRST_IN_XACT is specified in arrays that can be used to initialize an MQMSGPROPS structure.

aMsgPropId[i] = PROPID_M_FIRST_IN_XACT; // Property ID
aMsgPropVar[i].vt = VT_NULL;            // Type indicator

The following example is included in Using Message Queuing.

For an example of See

Identifying the first and last messages in a transaction

C/C++ Code Example: Checking Transaction Boundaries

See Also

© 2015 Microsoft