PROPID_M_BODY_SIZE
This property indicates the size of the message body.
- Type Indicator
VT_UI4 (or VT_NULL) - PROPVARIANT Field
ulVal - Property Values
The size of the message body returned by PROPID_M_BODY.
Remarks
PROPID_M_BODY_SIZE is used only by the receiving application to retrieve the size of a message. It is used to determine the size of a message body before the message body is retrieved.
Each MSMQ message can have no more than 4 MB of data.
To retrieve the message body from a message, specify PROPID_M_BODY_SIZE and PROPID_M_BODY in the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned values. When specifying PROPID_M_BODY_SIZE, 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.
When MQReceiveMessage succeeds, first test the returned value of PROPID_M_BODY_SIZE to see if a message body exists. A returned value of 0 indicates that no body is attached to the message. A nonzero returned value indicates that a message body was returned by PROPID_M_BODY.
If MQReceiveMessage fails, returning an MQ_ERROR_BUFFER_OVERFLOW error, use the returned value of PROPID_M_BODY_SIZE to reallocate the message body buffer and call MQReceiveMessage again.
Example
This example shows how PROPID_M_BODY_SIZE and PROPID_M_BODY are specified in the MQMSGPROPS structure when retrieving the message body.
MsgProps.aPropID[i] = PROPID_M_BODY_SIZE; // Property ID
MsgProps.aPropVar[i].vt = VT_UI4; // Type indicator
i++
DWORD dwBodyBufferSize = 1024;
UCHAR *pucBodyBuffer = (UCHAR *)malloc(dwBodyBufferSize);
MsgProps.aPropID[i] = PROPID_M_BODY; // Property ID
MsgProps.aPropVar[i].vt = VT_VECTOR|VT_UI1; // Type indicator
MsgProps.aPropVar[i].caub.pElems = (UCHAR*)pucBodyBuffer;
MsgProps.aPropVar[i].caub.cElems = dwBodyBufferSize;
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, PROPID_M_BODY, MQMSGPROPS
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.