PROPID_M_BODY_TYPE (Compact 2013)

3/26/2014

This property indicates the type of body the message contains.

  • Type Indicator
    VT_UI4 (or VT_NULL)
  • PROPVARIANT Field
    ulVal
  • Property Values
    Type of message body. The default is 0.

Remarks

It is recommended that the sending application set PROPID_M_BODY_TYPE when 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 COM implementation does this.

To set the body type, specify PROPID_M_BODY_TYPE and PROPID_M_BODY in the MQMSGPROPS structure and call MQSendMessage.

To retrieve the body type, specify PROPID_M_BODY_TYPEin the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned value.

When specifying PROPID_M_BODY_TYPE, you can set its Type Indicator to VT_NULL. When the Type Indicator is set to VT_NULL, MSMQ sets the VT field to the appropriate type indicator.

The body of a message can consist of any type of information.

The sending and receiving applications are responsible to understand the type of information in the message.

For example, if the sending application sends a binary file with an internal structure, the receiving application is responsible to know how to decipher what was sent.

The MSMQ COM 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, which indicates a serialized object that supports IPersistStream and IPersistStorage
  • VT_STORED_OBJECT, which indicates a serialized object that supports IPersistStream and IPersistStorage

Many persistent objects, such as Microsoft Office documents, can be sent as MSMQ messages.

This property is not available when you use COM components.

Examples

MsgProps.aPropID[i] = PROPID_M_BODY_TYPE;            // Property ID
MsgProps.aPropVar[i].vt = VT_UI4;                    // Type indicator
i++;

Note

OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header

mq.h

See Also

Reference

MSMQ Properties
MQReceiveMessage
MQSendMessage
PROPID_M_BODY
MQMSGPROPS

Other Resources

IPersistStorage