PROPID_Q_INSTANCE

Optional read-only. The PROPID_Q_INSTANCE property identifies a specific public queue.

Type Indicator
VT_CLSID
PROPVARIANT Field
*puuid
Property Values
GUID (globally unique identifier) of queue.

Remarks

The PROPID_Q_INSTANCE property identifies the created public queue. (It is not an instance of an open queue.) This property is set by MSMQ when the application calls MQCreateQueue. An MQ_ERROR_PROPERTY_NOTALLOWED error is returned if any attempt is made to set this property.

PROPID_Q_INSTANCE only applies to public queues. An MQ_INFORMATION_PROPERTY_IGNORED error is returned if an attempt is made to get this property for a private queue.

To retrieve the identifier of a public queue, specify PROPID_Q_INSTANCE in the MQQUEUEPROPS structure and call MQGetQueueProperties (or MQLocateBegin when starting a query) 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 retrieving the identifier of the queue. Note that a buffer of type CLSID must be declared to receive the returned GUID.

//To retrieve the queue identifier
CLSID InstanceBuffer;
aPropID[i] = PROPID_Q_INSTANCE;    // Property identifier
aVariant[i].vt = VT_CLSID;         // Type indicator
avariant[i].puuid = &InstanceBuffer
i++
 
For complete examples of… See…
Retrieving the identifier of the queue Retrieving PROPID_Q_INSTANCE

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