Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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_BODYin the MQMSGPROPSstructure and call MQSendMessage.

To retrieve the body type, specify PROPID_M_BODY_TYPEin the MQMSGPROPSstructure. Then call MQReceiveMessageand 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 IPersistStreamand IPersistStorage

  • VT_STORED_OBJECT, which indicates a serialized object that supports IPersistStreamand 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

Copy Code
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
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also