The PROPID_M_ADMIN_QUEUE_LEN property indicates the length (in Unicode characters) of the administration queue's format name buffer.
The PROPID_M_ADMIN_QUEUE_LEN property is only used by the receiving application when looking for the administration queue used by the sending application.
To find out which queue is being used as the administration queue, pass PROPID_M_ADMIN_QUEUE and PROPID_M_ADMIN_QUEUE_LEN to MQReceiveMessage and examine the returned values.
On input, PROPID_M_ADMIN_QUEUE_LEN specifies the length of the format name buffer (in Unicode characters) allocated by the receiving application. The buffer should be large enough to hold the format name string including the null-terminating character.
On return, this property holds the length (in Unicode characters) of the PROPID_M_ADMIN_QUEUE format name string including the null-terminating character.
MQReceiveMessage fails if the buffer is not large enough to hold the format name, and PROPID_M_ADMIN_QUEUE_LEN is set to the required buffer length of the format name string.
To see how PROPID_M_ADMIN_QUEUE_LEN is used when reading an acknowledgment message, see Sending Messages that Request Acknowledgments.
The following example allocates a buffer of size 60 for the format name of the administration queue, then sets the PROPID_M_ADMIN_QUEUE and PROPID_M_ADMIN_QUEUE_LEN properties.
MQMSGPROPS MsgProps;
PROPVARIANT aVariant[10];
MSGPROPID aPropId[10];
DWORD PropIdCount = 0;
HRESULT hr;
QUEUEHANDLE hQueue;
//
// Prepare the PROPVARIANT array.
//
#define ADMIN_QUEUE_BUFF_LEN 60
WCHAR szwAdminQueueFormatName[ADMIN_QUEUE_BUFF_LEN];
//
// Set the PROPID_M_ADMIN_QUEUE property.
//
aPropId[PropIdCount] = PROPID_M_ADMIN_QUEUE; //PropId
aVariant[PropIdCount].vt = VT_LPWSTR; //Type
aVariant[PropIdCount].pwszVal = szwAdminQueueFormatName; //allocated buffer
PropIdCount++;
//
// Set the PROPID_M_ADMIN_QUEUE_LEN property.
//
aPropId[PropIdCount] = PROPID_M_ADMIN_QUEUE_LEN; //PropId
aVariant[PropIdCount].vt = VT_UI4; //Type
aVariant[PropIdCount].ulVal = ADMIN_QUEUE_BUFF_LEN; //Value
PropIdCount++;
//
// Set the MQMSGPROPS structure.
//
MsgProps.cProp = PropIdCount; //Number of properties.
MsgProps.aPropID = aPropId; //Id of properties.
MsgProps.aPropVar = aVariant; //Value of properties.
MsgProps.aStatus = NULL; //No Error report.
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.
MQReceiveMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_ADMIN_QUEUE