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 read-only property provides the length of the message body in bytes.

Syntax

HRESULT get_BodyLenth( 
  long* 
pcbBody 
);

Parameters

pcbBody

Length, in bytes, of the message.

Return Value

The following table describes the common return values.

Value Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

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

MSMQMessage.BodyLengthcan be used by sending or receiving applications.

  • Sending applications can use MSMQMessage.BodyLengthto find the size of the message body as soon as MSMQMessage.Bodyis set, including before and after the message is sent.

  • Receiving applications can use BodyLengthto find the size of a message before or after retrieving the message body.

Equivalent Function property

When using functions, the size of body of the message can be retrieved using the PROPID_M_BODY_SIZEproperty.

Requirements

Header mqoai.h
Library mqoa.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also