(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.
A GUID value. The default is NULL_GUID.
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.
|To generate a GUID, run the GUIDGEN program provided by Microsoft® Developer Network.|
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.
|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.
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
Setting and retrieving the service type identifier of the queue