This property specifies the length of the information in the PROPID_M_EXTENSION property.

  • Type Indicator
    VT_UI4 (or VT_NULL)
  • Property Values
    The size (in bytes) of the extension information specified by PROPID_M_EXTENSION.


PROPID_M_EXTENSION_LEN is used only by the receiving application. It is used whenever the receiving application specifies PROPID_M_EXTENSION in the MQMSGPROPS structure.

To retrieve extension information, set PROPID_M_EXTENSION and PROPID_M_EXTENSION_LEN in the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned values. When specifying PROPID_M_EXTENSION_LEN, 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_EXTENSION_LEN to see if any extension information exists. A returned value of 0 indicates that no information was sent by the sending application. A nonzero returned value indicates the extension information was returned by PROPID_M_EXTENSION.

If MQReceiveMessage fails, returning an MQ_ERROR_BUFFER_OVERFLOW error, use the returned value of PROPID_M_EXTENSION_LEN to reallocate the extension information buffer and call MQReceiveMessage again.

This property is not needed when you are using COM components.


This example shows how PROPID_M_EXTENSION_LEN and PROPID_M_EXTENSION are specified in the MQMSGPROPS structure.

aMsgPropId[i] = PROPID_M_EXTENSION_LEN;     // Property ID
aMsgPropVar[i].vt = VT_UI4;                 // Type indicator

aMsgPropId[i] = PROPID_M_EXTENSION;         // Property ID
aMsgPropVar[i].vt = VT_UI1 | VT_VECTOR;     // Type indicator


OS Versions: Windows CE 2.0 and later. Versions prior to 2.12 require the MSMQ add-on pack.
Header: Mq.h.

See Also


 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.