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 is 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 when creating a queue, specify PROPID_Q_LABEL in the MQQUEUEPROPS structure and call MQCreateQueue.

To change the label of a queue, specify PROPID_Q_LABEL in the MQQUEUEPROPS structure and call MQSetQueueProperties.

To retrieve the label of a queue, specify PROPID_Q_LABEL in the MQQUEUEPROPS structure and call MQGetQueueProperties and examine its returned value. When specifying PROPID_Q_LABEL, 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 for both setting and retrieving the queue's label. Note that when retrieving the queue's label, the type indicator is set to VT_NULL.

//To set the queue's label
aPropID[i] = PROPID_Q_LABEL;                // Property identifier
aVariant[i].vt = VT_LPWSTR;                 // Type indicator
aVariant[i].pwszVal = L"Test Queue";        // Label of queue

//To retrieve the queue's label
aPropID[i] = PROPID_Q_AUTHENTICATE;         // Property identifier
aVariant[i].vt = VT_NULL;                   // Type indicator
i++
 
For complete examples of… See…
Creating a public or private queue Creating a Queue
Retrieving the label of the queue Retrieving PROPID_Q_LABEL

QuickInfo

  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.

See Also

MQCreateQueue, MQGetQueueProperties, MQSetQueueProperties