Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This property specifies the queue where application-generated response messages are returned.
- Type Indicator
-
VT_LPWSTR
- PROPVARIANT Field
-
pwszVal
- Property Values
-
Format name of the response queue (the default is none).
Remarks
PROPID_M_RESP_QUEUE is used to send the format name of a queue to the receiving application. Typically, this is done so the receiving application can send a response message back to the sending application.
This property can also be used to send the format name of other queues. For example, you can set this property to the format name of destination queue of the original message when you create a response message.
You can also use this property to send the format name of a local private queue, which is otherwise inaccessible, to another application.
Response messages are application-defined. The sending and receiving application must define what is in the message, as well as what is to be done when the response message arrives in the response queue.
To set the format name of a response queue, specify PROPID_M_RESP_QUEUE in the MQMSGPROPSstructure and call MQSendMessage.
To find out where to send a response message, specify PROPID_M_RESP_QUEUE and PROPID_M_RESP_QUEUE_LENin the MQMSGPROPSstructure. Then call MQReceiveMessageand examine the returned values.
Before using the returned value of PROPID_M_RESP_QUEUE, inspect the returned value of PROPID_M_RESP_QUEUE_LEN to see if a response message was requested.
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.
Examples
The following examples show how PROPID_M_RESP_QUEUE is specified in the MQMSGPROPSstructure for setting and retrieving the response queue format name.
To send the format name
Copy Code | |
---|---|
aMsgPropId[i] = PROPID_M_RESP_QUEUE; // Property ID aMsgPropVar[i].vt = VT_LPWSTR; // Type indicator aMsgPropVar[i].pwszVal = wszRespFormatNameBuffer; i++; |
To retrieve the format name
Copy Code | |
---|---|
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 |
Windows Mobile | Windows Mobile Version 5.0 and later |