Optional. The Label property of the MSMQQueueInfo object specifies a description of the queue.
Property Label As String
An application-defined string (default is ""). The maximum length of the string is MQ_MAX_Q_LABEL_LEN (124 Unicode characters).
The label of the queue can be used to identify the queue. For example, queues that accept incoming message may all use the label "Incoming Queue". (The examples provided in Using Message Queuing create queues with the label "Test Queue".)
The Label property can be used as search criteria when making a query of existing public queues. See the MSMQQuery.LookupQueue method for details on running a query.
To reset or retrieve the label of an existing queue, your application must first obtain an MSMQQueueInfo object that represents the queue. This object can be returned by a query using the MSMQQuery.LookupQueue method or created by the sending or receiving application.
Before using an application-created MSMQQueueInfo object, the application must initialize it to reference the queue by setting its MSMQQueueInfo.PathName or MSMQQueueInfo.FormatName property. For public queues, setting the FormatName property with a cached public format name instead of the PathName property frees Message Queuing from the need to retrieve information stored in the directory service to generate this format name. Direct format names can be used only for local private queues.
To reset the label of an existing queue, set Label to a new value and call the MSMQQueueInfo.Update method. This method updates the queue information stored by Message Queuing. For public queues, this information is stored in the directory service. For private queues, this information is stored on the computer where the messages of the queue are stored.
To retrieve the stored label of a queue, call the MSMQQueueInfo.Refresh method and inspect the Label property. The property values of the MSMQQueueInfo object are not updated with the values stored by Message Queuing until the MSMQQueueInfo.Refresh method is called.
Message Queuing COM components ignore any characters that follow the first Null character in a string without returning an error.
Equivalent API Function Property
With function calls, the equivalent property is PROPID_Q_LABEL.
The following examples are included in Using Message Queuing.
|For an example of||See|
Setting the label when creating a queue
Setting and retrieving the label of an existing queue
Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Mqoai.h.
Library: Use Mqoa.lib.