PROPID_M_BODY_TYPE

The PROPID_M_BODY_TYPE 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

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 queue. 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 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 type of a message by passing PROPID_M_BODY_TYPE to MQReceiveMessage. When passing this property to MQReceiveMessage, the corresponding VT field in the aPropVar array can be set to VT_NULL.

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