Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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 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 MQQUEUEPROPSstructure and call MQCreateQueue.

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

To retrieve the label of a queue, specify PROPID_Q_LABEL in the MQQUEUEPROPSstructure and call MQGetQueuePropertiesand examine its returned value.

When specifying PROPID_Q_LABEL, set the type indicator for PROPID_Q_LABELto VT_NULL so MSMQ allocates memory for the label.

When you finish using the queue, free the allocated memory with MQFreeMemory.

Examples

The following examples show how PROPID_Q_LABEL is specified in the MQQUEUEPROPSstructure for setting and retrieving the label of a queue. When retrieving the label, the type indicator is set to VT_NULL.

To set the label of a queue

Copy Code
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

Copy Code
aPropID[i] = PROPID_Q_LABEL; 	 // Property identifier
aVariant[i].vt = VT_NULL; 			 // Type indicator
i++;
Note:
OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header mq.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also