PROPID_Q_TYPE

Optional. The PROPID_Q_TYPE property specifies the type of service provided by the queue. The queue's type allows applications to categorize their queues according to how they are used.

Type Indicator
VT_CLSID
PROPVARIANT Field
*puuid
Property Values
GUID value. The default is NULL_GUID.

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 mail services have a specific MSMQ-defined MAPI service type.

Note  To generate a GUID, run the Uuidgen.exe program provided by Microsoft Developer Network. (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 MQLocateBegin and MQLocateNext).

To set the queue's initial service type, specify PROPID_Q_TYPE in the MQQUEUEPROPS structure and call MQCreateQueue.

To change the queue's service type, specify PROPID_Q_TYPE in the MQQUEUEPROPS structure and call MQSetQueueProperties with a new GUID.

To retrieve the service type of a queue, specify PROPID_Q_TYPE in the MQQUEUEPROPS structure and call MQGetQueueProperties and examine its returned value.

Note  The returned queue identifier is a binary GUID. To convert the returned GUID to a string, use UUIDToString(). This function is described in the Platform SDK. When using this function, include the rpc.h header file in your source code.

Example

This example shows how PROPID_Q_INSTANCE is specified in the MQQUEUEPROPS structure for both setting and retrieving the queue type. Note that when you are retrieving the queue type, a buffer of type CLSID must be declared to receive the returned GUID.

//To set the queue type
aPropID[i] = PROPID_Q_TYPE;                 // Property identifier
aVariant[i].vt = VT_CLSID;                  // Type indicator
aVariant[i].puuid = &PRINTER_SERVICE_TYPE;  // Service type of queue

//To retrieve the queue type
CLSID TypeBuffer;
aPropID[i] = PROPID_Q_TYPE;        // Property identifier
aVariant[i].vt = VT_CLSID;         // Type indicator
aVariant[i].puuid = &TypeBuffer
i++
 
For complete examples of… See…
Creating a public or private queue Creating a Queue
Locating a public queue by its service type Locating a Public Queue
Retrieving the queue's service type Retrieving PROPID_Q_TYPE

QuickInfo

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

See Also

MQCreateQueue, MQGetQueueProperties, MQLocateBegin, MQLocateNext, MQSetQueueProperties