PROPID_M_RESP_QUEUE_LEN

The PROPID_M_RESP_QUEUE_LEN property indicates the length (in Unicode characters) of the response queue buffer.

Type Indicator
VT_UI4
PROPVARIANT Field
ulVal
Property Values
Length (in Unicode characters) of the response queue buffer.

Remarks

The PROPID_M_RESP_QUEUE_LEN property is used only by the receiving application when checking if a response message is expected or when the sending application has passed the format name of a private queue to the receiving application.

To find the format name of the response queue or private queue, pass PROPID_M_RESP_QUEUE and PROPID_M_RESP_QUEUE_LEN to MQReceiveMessage.

On input, PROPID_M_RESP_QUEUE_LEN specifies the length of the format name buffer (in Unicode characters) allocated by the receiving application. The buffer should be large enough to hold the format name string including the null-terminating character.

On return, this property holds the length (in Unicode characters) of the PROPID_M_RESP_QUEUE format name string including the null-terminating character.

MQReceiveMessage succeeds if the buffer is large enough to hold the format name of the response queue. MQReceiveMessage fails if the buffer is not large enough to hold the format name and PROPID_M_RESP_QUEUE_LEN is set to the required buffer length of the if format name string.

Example

The following example allocates a buffer of size 60 characters for the format name of the response queue and then sets the PROPID_M_RESP_QUEUE and PROPID_M_RESP_QUEUE_LEN properties.

MQMSGPROPS MsgProps;
PROPVARIANT aVariant[10];
MSGPROPID aPropId[10];
DWORD PropIdCount = 0;

HRESULT hr;
QUEUEHANDLE hQueue;

//
// Prepare the PROPVARIANT array.
// 

#define RESP_QUEUE_BUFF_LEN     = 60
WCHAR szwRespQueueFormatName[RESP_QUEUE_BUFF_LEN];

//
// Set the PROPID_M_RESP_QUEUE property.
//
aPropId[PropIdCount] = PROPID_M_RESP_QUEUE;     //Property identifier.
aVariant[PropIdCount].vt = VT_LPWSTR;           //Property type.
aVariant[PropIdCount].pwszVal = szwRespQueueFormatName;   //Allocated buffer.
PropIdCount++;

//
// Set the PROPID_M_RESP_QUEUE_LEN property.
//
aPropId[PropIdCount] = PROPID_M_RESP_QUEUE_LEN; //Property identifier.
aVariant[PropIdCount].vt = VT_UI4;              //Property type.
aVariant[PropIdCount].ulVal = RESP_QUEUE_BUFF_LEN;   //Property value.
PropIdCount++;

//
// Set the MQMSGPROPS structure.
//
MsgProps.cProp = PropIdCount;       //Number of properties.
MsgProps.aPropID = aPropId;         //Id of properties.
MsgProps.aPropVar = aVariant;       //Value of properties.
MsgProps.aStatus  = NULL;           //No Error report.
 
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQReceiveMessage, PROPID_M_RESP_QUEUE