Share via


PROPID_M_DEST_QUEUE

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This property identifies the original destination queue of a message.

  • Type Indicator
    VT_LPWSTR
  • PROPVARIANT Field
    pwszVal
  • Property Values
    Format name of the destination queue.

Remarks

PROPID_M_DEST_QUEUE is only used by the receiving application. MSMQ attaches this property to the message according to the destination queue specified in the call to MQSendMessage.

PROPID_M_DEST_QUEUE is typically used to determine the destination queue of a message that is in a journal or dead-letter queue; however, it can also be used when sending response message back to a response queue.

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

If MQReceiveMessage fails, returning an MQ_ERROR_BUFFER_OVERFLOW error, use the returned value of PROPID_M_DEST_QUEUE_LENto reallocate the format name buffer and then call MQReceiveMessage again.

Examples

This example shows how PROPID_M_DEST_QUEUE is specified in the MQMSGPROPS structure for retrieving the destination queue format name.

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
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

MQReceiveMessage
MQSendMessage
PROPID_M_DEST_QUEUE_LEN
MQMSGPROPS