PROPID_Q_LABEL

Optional. This 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 label of a queue is used to identify the queue.

For public queues, the 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.

Examples

The following examples show how PROPID_Q_LABEL is specified in the MQQUEUEPROPS structure for setting and retrieving the label of a queue. Note that when retrieving the label, the type indicator is set to VT_NULL.

To set the label of a queue

LPWSTR wszQueueLabel = L"Test Queue";
aPropID[i] = PROPID_Q_LABEL;                // Property identifier
aVariant[i].vt = VT_LPWSTR;                 // Type indicator
aVariant[i].pwszVal = wszQueueLabel ;       // Label of queue

To retrieve the label of a queue

aPropID[i] = PROPID_Q_LABEL;         // Property identifier
aVariant[i].vt = VT_NULL;                   // Type indicator
i++;

Requirements

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

See Also

MQCreateQueue | MQFreeMemory | MQGetQueueProperties | MQSetQueueProperties | MQQUEUEPROPS

 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.