PROPID_Q_LABEL

Optional. The PROPID_Q_LABEL property specifies a description of the queue.

Type Indicator
VT_LPWSTR
PROPVARIANT Field
pwszVal
Property Value
String (default is ""). The maximum length of the string is MQ_MAX_Q_LABEL_LEN (124 Unicode characters).

Remarks

The queue's label can be used to identify the queue.

For public queues, the queue's label can be used as the search criteria for a query. By using the same label for several queues, the application can later run a query on the queue label and locate all the queues. (A query can also be used to retrieve the label of a public queue.)

To specify the label of a queue, pass PROPID_Q_LABEL to MQCreateQueue.

To change the label of a queue, pass PROPID_Q_LABEL to MQSetQueueProperties.

To find the label of a queue, pass PROPID_Q_LABEL to MQGetQueueProperties and examine its returned value. When calling MQGetQueueProperties, set the type indicator for PROPID_Q_LABEL to VT_NULL so that MSMQ will allocate the memory needed for the label. Later, the allocated memory must be freed using MQFreeMemory.

Example

This example shows how PROPID_Q_LABEL is specified in the MQQUEUEPROPS structure:

    aPropId[PropIdCount] = PROPID_Q_LABEL;    'PropId
    aVariant[PropIdCount].vt = VT_LPWSTR;     'Type
    aVariant[PropIdCount].pwszVal = L"MyPublicQueue";
 

For an example of using PROID_Q_LABEL, see Creating a Queue.

See Also

MQCreateQueue, MQGetQueueProperties, MQSetQueueProperties


© 1997 by Microsoft Corporation. All rights reserved.