PROPID_M_MSGID

This property indicates the MSMQ-generated identifier of the message.

  • Type Indicator
    VT_VECTOR | VT_UI1
  • PROPVARIANT Field
    caub
  • Property Values
    20-byte MSMQ-generated message identifier.

Remarks

MSMQ generates a 20-byte message identifier when the message is sent. This identifier is composed of the machine globally unique identifier (GUID) of the computer that sent the message plus an identifier that uniquely identifies each message on the computer. By combining these two components, the message identifier is unique within your enterprise.

MSMQ generates message identifiers for all messages, including acknowledgment messages generated by MSMQ and MSMQ connector applications. When an acknowledgment message is created, the identifier of the original message can be found in the PROPID_M_CORRELATIONID property of the acknowledgment message.

The message identifier is an array of bytes that can be read by the sending or receiving application. To retrieve the identifier of a message, specify PROPID_M_MSGID in the MQMSGPROPS structure. Then call MQSendMessage or MQReceiveMessage and examine the returned identifier.

This property can also be used when sending response messages. For example, the application creating the response message can set the correlation identifier (PROPID_M_CORRELATIONID) of the response message to the identifier of the message it read from the queue. This gives the application reading the response message a way to know which message the response is referring to.

Examples

The following example shows how PROPID_M_MSGID is specified in the MQMSGPROPS structure for retrieving the identifier of a message.

MsgProps.aPropID[i] = PROPID_M_MSGID;                 // Property ID
MsgProps.aPropVar[i].vt = VT_VECTOR|VT_UI1;          // Type indicator
MsgProps.aPropVar[i].caub.pElems = MessageID;
MsgProps.aPropVar[i].caub.cElems = sizeof(MessageID);
i++

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later. Versions prior to 2.12 require the MSMQ add-on pack. Mq.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MQReceiveMessage, MQSendMessage, PROPID_M_CORRELATIONID, MQMSGPROPS

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.