The PROPID_M_LABEL_LEN property identifies the length (in Unicode characters) of the message label buffer.
The PROPID_M_LABEL_LEN property is only used by the receiving application when calling MQReceiveMessage. It is required whenever PROPID_M_LABEL is passed to MQReceiveMessage.
On input, PROPID_M_LABEL_LEN specifies the size (in Unicode characters) of the message label buffer allocated by the receiving application. The buffer should be large enough to hold the complete label string including the end-of-string character.
On return, this property holds the length (in Unicode characters) of the label string plus the end-of-string character.
MQReceiveMessage succeeds if the buffer is large enough to hold the message label. If the buffer is too small, MQReceiveMessage fails and PROPID_M_LABEL_LEN can be used to obtain the required buffer length of the message label string.
The following example allocates a buffer of size 40 for the message label.
WCHAR buffer[40]; //Allocate buffer of size 40.
Prop[0]=PROPID_M_LABEL;
PropVar[0].vt=VT_LPWSTR;
PropVar[0].pwszVal=&buffer[0];
Prop[1]=PROPID_M_LABEL_LEN;
PropVar[1].vt=VT_UI4;
PropVar[1].ulVal=40; //Buffer length.
MQReceiveMessage(…);
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.
MQReceiveMessage, PROPID_M_LABEL