共用方式為


PROPID_M_XACT_STATUS_QUEUE_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.) The PROPID_M_XACT_STATUS_QUEUE_LEN property indicates the length (in Unicode characters) of the format name buffer for the transaction status queue.

Property ID

PROPID_M_XACT_STATUS_QUEUE_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 connector application.

On return: The length (in Unicode characters) of the format name string, including the null-terminating character, returned by PROPID_M_XACT_STATUS_QUEUE.

Remarks

The PROPID_M_XACT_STATUS_QUEUE_LEN property is used only by the connector application when receiving messages sent to a foreign queue. It is required whenever PROPID_M_XACT_STATUS_QUEUE is passed in MQReceiveMessage or MQReceiveMessageByLookupId.

To retrieve the format name of the status queue, specify PROPID_M_XACT_STATUS_QUEUE_LEN and PROPID_M_XACT_STATUS_QUEUE in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine the returned values.

If MQReceiveMessage or MQReceiveMessageByLookupId fails, returning an MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL error, use the returned value of PROPID_M_XACT_STATUS_QUEUE_LEN to reallocate the format name buffer and call the applicable function again.

Equivalent COM Property

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

Example Code

The following code fragment shows how PROPID_M_XACT_STATUS_QUEUE_LEN and PROPID_M_XACT_STATUS_QUEUE are specified in arrays that can be used to initialize an MQMSGPROPS structure when retrieving the format name of the queue.

ULONG ulBufferLength = 256;  
WCHAR * wszStatusQueueBuffer = NULL;  
wszStatusQueueBuffer = (WCHAR*)malloc(ulBufferLength*sizeof(WCHAR));  
if (wszStatusQueueBuffer == NULL)  
{  
  return MQ_ERROR_INSUFFICIENT_RESOURCES;  
}  
memset(wszStatusQueueBuffer, 0, ulBufferLength*sizeof(WCHAR));  
aMsgPropId[i] = PROPID_M_XACT_STATUS_QUEUE;      // Property ID  
aMsgPropVar[i].vt = VT_LPWSTR;                   // Type indicator  
aMsgPropVar[i].pwszVal = wszStatusQueueBuffer;  
i++;  
aMsgPropId[i] = PROPID_M_XACT_STATUS_QUEUE_LEN;  // Property ID  
aMsgPropVar[i].vt = VT_UI4;                      // Type indicator  
aMsgPropVar[i].ulVal = ulBufferLength;  
i++;  

See Also

Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
PROPID_M_XACT_STATUS_QUEUE