Partager via


PROPID_M_ADMIN_QUEUE_LEN

 

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.) The PROPID_M_ADMIN_QUEUE_LEN property indicates the length (in Unicode characters) of the format name buffer of the administration queue.

Property ID

PROPID_M_ADMIN_QUEUE_LEN

Type Indicator

VT_UI4

MQPROPVARIANT Field

ulVal

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.

Remarks

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)  
{  
  return MQ_ERROR_INSUFFICIENT_RESOURCES;  
}  
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;  
i++;  
  
aMsgPropId[i] = PROPID_M_ADMIN_QUEUE;           // Property ID  
aMsgPropVar[i].vt = VT_LPWSTR;                  // Type indicator  
aMsgPropVar[i].pwszVal = wszAdminFormatNameBuffer;  
i++;  

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

Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
PROPID_M_ADMIN_QUEUE