Optional. The ServiceTypeGuid property specifies the type of service provided by the queue.
Type: | GUID |
Run time: | read/write |
object.ServiceTypeGuid
Syntax Element | Description |
object | Queue information (MSMQQueueInfo) object that defines queue. |
GUID. Pre-defined or application generated.
The queue's service type can be used to identify the queue.
It is recommended that the service type of the queue be specified when the queue is created. In most cases, the service type of the queue can be defined by the application; however, some queues used by MSMQ require a specific MSMQ-defined service type. For example, input queues used by the MSMQ MAPI Transport Provider have a specific MSMQ-defined service type.
Note To generate a GUID, run the UUIDGEN.EXE program provided by MSDN. (For information about UUIDGEN.EXE, see the Microsoft Platform SDK.)
The queue's service type can also be used to locate public queues registered in MQIS (see LookupQueue).
To specify the queue's service type, set ServiceTypeGuid and call the MSMQQueueInfo object's Create method.
To reset the service type of a queue after the queue is created, set Authenticate to a new GUID and, if the queue is open, call the MSMQQueueInfo object's Update method. If the queue is not open do not call Update, the queue's properties are updated automatically when the queue is opened.
To find the service type of a queue, call the MSMQQueueInfo object's Refresh method.
This example creates a private queue on the local machine, setting the queue's service type to an application-defined GUID. To try this example using Microsoft® Visual Basic® (version 5.0), paste the code into the Code window of a form, and then run the example and click the form.
Dim qinfo As MSMQQueueInfo Private Sub Form_Click() Set qinfo = New MSMQQueueInfo qinfo.PathName = ".\PRIVATE$\myqueue" qinfo.Label = "Test Queue" qinfo.ServiceTypeGuid = "{bed40680-b773-11d0-8b96-00aa0062c8e9}" qinfo.Create MsgBox "Queue's Format name is: " + qinfo.FormatName End Sub
Create, FormatName, Label, LookupQueue, PathName