PROPID_M_ADMIN_QUEUE_LEN

The PROPID_M_ADMIN_QUEUE_LEN property indicates the length (in Unicode characters) of the administration queue's format name buffer.

Type Indicator
VT_UI4
PROPVARIANT Field
ulVal
Property Values
Length (in Unicode characters) of the administration queue's format name buffer.

Remarks

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.

Example

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.
 

See Also

MQReceiveMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_ADMIN_QUEUE


© 1997 by Microsoft Corporation. All rights reserved.