다음을 통해 공유


PROPID_M_RESP_QUEUE_LEN (Windows Embedded CE 6.0)

1/6/2010

This property indicates the length (in Unicode characters) of the response queue format name buffer.

  • 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_RESP_QUEUE.

Remarks

The PROPID_M_RESP_QUEUE_LEN property is only used by the receiving application to determine if a response message is needed and to determine the format name of a response queue.

On input, PROPID_M_RESP_QUEUE_LEN should be large enough to hold the format name string including the null-terminating character.

To retrieve the format name of the response queue, set PROPID_M_RESP_QUEUE and PROPID_M_RESP_QUEUE_LEN in the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned values.

When MQReceiveMessage succeeds, test the returned value of PROPID_M_RESP_QUEUE_LEN to see if a response queue was specified.

A returned value of 0 indicates that a response queue was not specified by the sending application and no response message is needed.

A nonzero return value indicates that the format name of a response queue was returned by PROPID_M_RESP_QUEUE.

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

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

Examples

This example shows how PROPID_M_RESP_QUEUE_LEN is specified in the MQMSGPROPS structure when retrieving the format name of the response queue.

aMsgPropId[i] = PROPID_M_RESP_QUEUE_LEN;    // Property ID
aMsgPropVar[i].vt = VT_UI4;                 // Type indicator
aMsgPropVar[i].ulVal = dwRespFormatNameBufferLength;
i++;
aMsgPropId[i] = PROPID_M_RESP_QUEUE;        // Property ID
aMsgPropVar[i].vt = VT_LPWSTR;              // Type indicator
aMsgPropVar[i].pwszVal = wszRespFormatNameBuffer;
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

See Also

Reference

MSMQ Properties
MQReceiveMessage
PROPID_M_RESP_QUEUE
MQMSGPROPS