Share via


PROPID_Q_TYPE

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

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

Property ID

PROPID_Q_TYPE

Type Indicator

VT_CLSID

MQPROPVARIANT Field

puuid

Property Value

A GUID value. The default is NULL_GUID.

Remarks

The service type of the queue 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 Message Queuing require a specific service type that is defined by Message Queuing.

Note

To generate a GUID, run the GUIDGEN program provided by Microsoft® Developer Network.

The service type of the queue can also be used to locate public queues registered in the directory service (see MQLocateBegin and MQLocateNext).

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

To change the service type of the queue, 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.

When retrieving the service type GUID, the type indicator can be set to VT_CLSID or VT_NULL. If you set the type indicator equal to VT_NULL, Message Queuing automatically changes the type indicator to VT_CLSID and allocates memory for the buffer needed during the function call. In that case, after you no longer need the buffer, you must free the memory allocated for it using MQFreeMemoryy.

Note

The returned queue identifier is a binary GUID. To convert the returned GUID to a string, use UuidToString. When using this function, include the Rpcdce.h header file in your source code and instruct your compiler to use the Rpcrt4.lib library.

Equivalent COM Property

When using COM components, the service type identifier of the queue can be set and retrieved using the MSMQQueueInfo.ServiceTypeGuid property.

Example Code

The following code fragments show how PROPID_Q_TYPE is specified in arrays that can be used to initialize an MQQUEUEPROPS structure for setting and retrieving the queue type.

To Set the Queue Type

aQueuePropID[i] = PROPID_Q_TYPE;                 // Property identifier  
aQueuePropVar[i].vt = VT_CLSID;                  // Type indicator  
aQueuePropVar[i].puuid = &PRINTER_SERVICE_TYPE;  // Service type of queue  

To Retrieve the Queue Type

CLSID guidTypeBuffer;  
aQueuePropID[i] = PROPID_Q_TYPE;                 // Property identifier  
aQueuePropVar[i].vt = VT_CLSID;                  // Type indicator  
aQueuePropVar[i].puuid = &guidTypeBuffer  
i++;  

The following examples are included in Using Message Queuing.

For an example of See
Creating a queue C/C++ Code Example: Creating a Queue

 C/C++ Code Example: Creating a Transactional Queue
Setting and retrieving the service type identifier of the queue C/C++ Code Example: Setting PROPID_Q_TYPE

 C/C++ Code Example: Retrieving PROPID_Q_TYPE

See Also

Queue Properties
MQCreateQueue
MQFreeMemory
MQGetQueueProperties
MQLocateBegin
MQLocateNext
MQQUEUEPROPS
MQSetQueueProperties