PROPID_M_RESP_FORMAT_NAME_LEN
Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista
(Read-only, introduced in MSMQ 3.0.) The PROPID_M_RESP_FORMAT_NAME_LEN property indicates the length (in Unicode characters) of the format name buffer allocated by the receiving application or the length of the format name string returned in PROPID_M_RESP_FORMAT_NAME.
Property ID
PROPID_M_RESP_FORMAT_NAME_LEN
Type Indicator
VT_UI4
MQPROPVARIANT Field
ulVal
Property Value
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 in PROPID_M_RESP_FORMAT_NAME.
Remarks
The PROPID_M_RESP_FORMAT_NAME_LEN property is only used by the receiving application to allocate a buffer for the response queue set specified by the sending application. The sending application specifies response queues when it expects the receiving application to return response messages.
To retrieve the response queue set, include the following two message properties in the MQMSGPROPS structure, and then call MQReceiveMessage or MQReceiveMessageByLookupId.
PROPID_M_RESP_FORMAT_NAME_LEN
When the function call succeeds, first test the returned value of PROPID_M_RESP_FORMAT_NAME_LEN to see if a set of response queues was specified by the sending application. A returned value of 0 indicates that no response queues were specified. A non-0 returned value indicates that the set of response queues specified was returned by PROPID_M_RESP_FORMAT_NAME.
If MQReceiveMessage or MQReceiveMessageByLookupId fails, returning an MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL error, use the returned value of PROPID_M_RESP_FORMAT_NAME_LEN to reallocate the buffer, and call the applicable function again.
Equivalent COM Property
There is no equivalent COM property for this property.
Example Code
The following code fragment shows how PROPID_M_RESP_FORMAT_NAME and PROPID_M_RESP_FORMAT_NAME_LEN are specified in arrays that can be used to initialize an MQMSGPROPS structure.
ULONG ulBufferLength = 256;
WCHAR * wszRespFormatNameBuffer = NULL;
wszRespFormatNameBuffer = (WCHAR*)malloc(ulBufferLength*sizeof(WCHAR));
if (wszRespFormatNameBuffer == NULL)
{
return MQ_ERROR_INSUFFICIENT_RESOURCES;
}
memset(wszRespFormatNameBuffer, 0, ulBufferLength*sizeof(WCHAR));
aMsgPropId[i] = PROPID_M_RESP_FORMAT_NAME; // Property ID
aMsgPropVar[i].vt = VT_LPWSTR; // Type indicator
aMsgPropVar[i].pwszVal = wszRespFormatNameBuffer; // Application-defined buffer
i++;
aMsgPropId[i] = PROPID_M_RESP_FORMAT_NAME_LEN; // Property ID
aMsgPropVar[i].vt = VT_UI4; // Type indicator
aMsgPropVar[i].ulVal = ulBufferLength;
i++;
The following example is included in Using Message Queuing.
For an example of | See |
---|---|
Retrieving the response format name and reallocating memory for the response format name buffer to return a response message | C/C++ Code Example: Returning Response Messages |
See Also
Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
MQSendMessage
PROPID_M_RESP_FORMAT_NAME
PROPID_M_RESP_QUEUE_LEN