Expand Minimize


(Read-only.) The PROPID_M_ADMIN_QUEUE_LEN property indicates the length (in Unicode characters) of the format name buffer of the administration queue.

Property ID


Type Indicator




Property Value

On input: The length of the format name buffer (in Unicode characters) specified in the PROPID_M_ADMIN_QUEUE property.

On return: The length (in Unicode characters) of the format name string (including the null-terminating character) returned by PROPID_M_ADMIN_QUEUE.


PROPID_M_ADMIN_QUEUE_LEN is only used by the receiving application when retrieving the format name of the administration queue that was specified by the sending application. On input, PROPID_M_ADMIN_QUEUE_LEN should be large enough to hold the format name string of the administration queue plus its null-terminating character.

To retrieve the format name of the administration queue, specify PROPID_M_ADMIN_QUEUE_LEN and PROPID_M_ADMIN_QUEUE in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine the returned values.

When the function call succeeds, first test the returned value of PROPID_M_ADMIN_QUEUE_LEN to see if an administration queue was used. A returned value of 0 indicates that no administration queue was specified by the sending application. A non-0 returned value indicates that the format name of an administration queue was returned by PROPID_M_ADMIN_QUEUE.

If MQReceiveMessage or MQReceiveMessageByLookupId fails, returning an MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL error, use the returned value of PROPID_M_ADMIN_QUEUE_LEN to reallocate the format name buffer, and call the applicable function again.

Equivalent COM Property

This property is not needed when you are using COM components.

Example Code

The following code fragment shows how PROPID_M_ADMIN_QUEUE_LEN and PROPID_M_ADMIN_QUEUE are specified in arrays that can be used to initialize an MQMSGPROPS structure to retrieve the administration queue format name.

ULONG ulBufferLength = 256;
WCHAR * wszAdminFormatNameBuffer = NULL;
wszAdminFormatNameBuffer = (WCHAR*)malloc(ulBufferLength*sizeof(WCHAR));
if (wszAdminFormatNameBuffer == NULL)
memset(wszAdminFormatNameBuffer, 0, ulBufferLength*sizeof(WCHAR));
aMsgPropId[i] = PROPID_M_ADMIN_QUEUE_LEN;       // Property ID
aMsgPropVar[i].vt = VT_UI4;                     // Type indicator
aMsgPropVar[i].ulVal = ulBufferLength;

aMsgPropId[i] = PROPID_M_ADMIN_QUEUE;           // Property ID
aMsgPropVar[i].vt = VT_LPWSTR;                  // Type indicator
aMsgPropVar[i].pwszVal = wszAdminFormatNameBuffer;

The following example is included in Using Message Queuing.

For an example of See

Testing to see if acknowledgment messages were requested

C/C++ Code Example: Verifying Acknowledgment Requests

See Also

© 2015 Microsoft