PROPID_M_BODY

The PROPID_M_BODY property contains the body of the message.

Type Indicator
VT_VECTOR | VT_UI1
PROPVARIANT Field
caub
Property Values
Body of the message.

Remarks

Each MSMQ message can have no more than 4 MB of data.

The body of a message can consist of any type of information. It is the sending and receiving application's responsibility to understand the type of information that is in the body. For example, the sending application could send a binary file with any internal structure, and it would be the receiving application's responsibility to know how to decipher what was sent.

It is recommended that the sending application set PROPID_M_BODY_TYPE whenever sending messages. If PROPID_M_BODY_TYPE is not set, the application reading the message should assume the message is an array of bytes.The MSMQ Microsoft® ActiveX® implementation does this automatically.

Note  The MSMQ ActiveX implementation supports the following specific types: VT_I2. VT_UI2, VT_I4, VT_UI4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BOOL, VT_I1, VT_UI1, VT_BSTR, VT_ARRAY, VT_STREAMED_OBJECT, VT_STORED_OBJECT, where the last two indicate serialized objects that support IPersistStream and lPersistStorage. There are many persistent objects, such as all Microsoft® Office documents, that can be sent as MSMQ messages.

The receiving application can find the size of the message and its type by passing PROPID_M_BODY_SIZE and PROPID_M_BODY_TYPE to MQReceiveMessage.

When reading acknowledgment messages from an administration queue, PROPID_M_BODY only returns the original message's body if the acknowledgment message is a negative acknowledgment. Positive acknowledgment messages do not contain the body of the original message. For information on acknowledgment messages, see Acknowledgment Messages.

Example

This example shows how PROPID_M_BODY is specified in the MQMSGPROPS structure:

MsgProps.aPropID[i] = PROPID_M_BODY;                      //PropId
MsgProps.aPropVar[i].vt = VT_VECTOR|VT_UI1;               //Type
MsgProps.aPropVar[i].caub.pElems = "Hash hash";           //Value
MsgProps.aPropVar[i].caub.cElems = strlen ("Hash hash")+1;

For an example of using PROID_M_BODY, see:

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, PROPID_M_BODY_SIZE, PROPID_M_BODY_TYPE