ServiceTypeGuid
MSMQQueueInfo

Optional. The ServiceTypeGuid property specifies the type of service provided by the queue.

Type: GUID
Run time: read/write

Syntax

object.ServiceTypeGuid
 
Syntax Element Description
object Queue information (MSMQQueueInfo) object that defines the queue.

Settings

GUID. Predefined or application generated.

Remarks

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 Active Directory (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 because 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.

Example

This example creates a private queue on the local computer, 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, 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
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mqoai.h.
  Import Library: Use mqoa.lib.
  Unicode: Defined only as Unicode.

See Also

Create, FormatName, Label, LookupQueue, PathName