PROPID_MGMT_MSMQ_PRIVATEQ

(Read-only, introduced in MSMQ 3.0.) The PROPID_MGMT_MSMQ_PRIVATEQ property returns a list of the path names of all the private queues registered on the computer.

Property ID

PROPID_MGMT_MSMQ_PRIVATEQ

Type Indicator

VT_LPWSTR | VT_VECTOR

MQPROPVARIANT Field

calpwstr

Property Value

A counted array of pointers to strings containing the path names of all the private queues registered on the computer.

Remarks

To retrieve a list of the path names of all the private queues registered on the computer, include PROPID_MGMT_MSMQ_PRIVATEQ in the MQMGMTPROPS structure, and then call MQMgmtGetInfo.

When specifying PROPID_MGMT_MSMQ_PRIVATEQ 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 | VT_VECTOR and creates the buffers needed to receive the property values. The number of private queues found is returned in the cElems member of the calpwstr field of the applicable MQPROPVARIANT element in the property values array, and the path names are returned in the array of strings specified by the pElems member of the calpwstr field. After you no longer need the array of strings, you must free the memory allocated for it using MQFreeMemory.

Equivalent COM Property

When using COM components, you can retrieve a list of the path names of all the private queues registered on a computer using the MSMQApplication.PrivateQueues property.

Example Code

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

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

The following code fragment shows how to free the memory allocated for the list of the path names.

for (j = 0; j < aMgmtPropVar[i].calpwstr.cElems; j++)
{
    MQFreeMemory(aMgmtPropVar[i].calpwstr.pElems[j]);  //Free each element
}
MQFreeMemory(aMgmtPropVar[i].calpwstr.pElems);         //Free the array

The following example is included in Using Message Queuing.

For a complete example of See

Obtaining a list of all the private queues on a specific computer

C/C++ Code Example: Obtaining a List of Private Queues

See Also

Show:
© 2014 Microsoft