次の方法で共有


PROPID_M_DEST_QUEUE_LEN (Compact 2013)

3/26/2014

This property indicates the following:

  • The length (in Unicode characters) of the supplied format name buffer
  • The length of the returned format name string for the destination queue
  • Type Indicator
    VT_UI4
  • PROPVARIANT Field
    ulVal
  • Property Values
    On input, the length of the format name buffer (in Unicode characters) allocated by the receiving application.

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

Remarks

PROPID_M_DEST_QUEUE_LEN is required when PROPID_M_DEST_QUEUE is specified in the MQMSGPROPS structure.

To retrieve the format name of the destination queue, specify PROPID_M_DEST_QUEUE and PROPID_M_DEST_QUEUE_LEN in the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned values.

When MQReceiveMessage succeeds, the format name of the destination queue is returned in PROPID_M_DEST_QUEUE.

If MQReceiveMessage fails, returning an MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL error, use the returned value of PROPID_M_DEST_QUEUE_LEN to reallocate the format name buffer and call MQReceiveMessage again.

This property is not needed when you use COM components.

Examples

This example shows how PROPID_M_DEST_QUEUE_LEN and PROPID_M_DEST_QUEUE are specified in the MQMSGPROPS structure.

DWORD dwDestFormatNameBufferLength = MQ_MAX_Q_NAME_LEN;
WCHAR wszDestFormatNameBuffer[MQ_MAX_Q_NAME_LEN];
aMsgPropId[i] = PROPID_M_DEST_QUEUE;        // Property ID
aMsgPropVar[i].vt = VT_LPWSTR;              // Type indicator
aMsgPropVar[i].pwszVal = wszDestFormatNameBuffer;
i++;
aMsgPropId[i] = PROPID_M_DEST_QUEUE_LEN;   // Property ID
aMsgPropVar[i].vt = VT_UI4;                // Type indicator
aMsgPropVar[i].ulVal = dwDestFormatNameBufferLength;
i++;

Note

OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header

mq.h

See Also

Reference

MSMQ Properties
MQReceiveMessage
PROPID_M_DEST_QUEUE
MQMSGPROPS