Partager via


PROPID_MGMT_QUEUE_PATHNAME

 

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

(Read-only, introduced in MSMQ 3.0.) The PROPID_MGMT_QUEUE_PATHNAME property returns the path name of the queue.

Property ID

PROPID_MGMT_QUEUE_PATHNAME

Type Indicator

VT_LPWSTR

MQPROPVARIANT Field

pwszVal

Property Value

String that contains the path name of the queue: (A NULL string is returned if the queue is a remote private queue, or if the queue manager on the computer is operating offline and the queue is a remote public queue.)

Remarks

To retrieve the path name of the queue, include PROPID_MGMT_QUEUE_PATHNAME in the MQMGMTPROPS structure, and then call MQMgmtGetInfo.

This property can be retrieved only for an active queue. MQMgmtGetInfo will return a non-specific error (MQ_ERROR) if your application attempts to retrieve the path name of a queue that does not contain messages and is not opened by an application.

When specifying PROPID_MGMT_QUEUE_PATHNAME in the MQMGMTPROPS structure, set its type indicator to VT_NULL. During the function call, Message Queuing automatically changes the type indicator to VT_LPWSTR and creates the string buffer needed to receive the property value. After you no longer need the string buffer, you must free the memory allocated for it using MQFreeMemory.

Example Code

The following code fragment shows how PROPID_MGMT_QUEUE_PATHNAME E is specified in arrays that can be used to initialize an MQMGMTPROPS structure.

aMgmtPropID[i] = PROPID_MGMT_QUEUE_PATHNAME;    // Property identifier  
aMgmtPropVar[i].vt = VT_NULL;                   // Type indicator  
i++;  

The following line of code shows how to free the memory allocated for the path name.

MQFreeMemory(aMgmtPropVar[i].pwszVal);  

See Also

Management Properties
MQFreeMemory
MQMgmtGetInfo