PROPID_M_LABEL_LEN

The PROPID_M_LABEL_LEN property identifies the length (in Unicode characters) of the message label buffer.

Type Indicator
VT_UI4
PROPVARIANT Field
ulVal
Property Values
Length (in Unicode characters) of the message label buffer.

Remarks

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.

Example

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(à);
 

See Also

MQReceiveMessage, PROPID_M_LABEL


© 1997 by Microsoft Corporation. All rights reserved.