The ReceiveCurrent method is received by the server in an RPC_REQUEST packet. In response, the server retrieves the Message that is identified by the Cursor instance variable in the referenced queue's MessagePositionList and removes it.

 HRESULT ReceiveCurrent(
   [in, optional] VARIANT* Transaction,
   [in, optional] VARIANT* WantDestinationQueue,
   [in, optional] VARIANT* WantBody,
   [in, optional] VARIANT* ReceiveTimeout,
   [in, optional] VARIANT* WantConnectorType,
   [out, retval] IMSMQMessage4** ppmsg
 );

Transaction: A pointer to a VARIANT that MUST contain either of the following:

A VT_DISPATCH or a VT_DISPATCH | VT_BYREF that points to an MSMQTransaction object.

A VT_I4 that corresponds to one of the MQTRANSACTION (section 2.2.2.1) enumeration values.

If this parameter is not specified by the client, the server MUST use the default value MQ_MTS_TRANSACTION (0x00000001) in place of the unspecified value.

WantDestinationQueue: A pointer to a VARIANT (VT_BOOL).

If this parameter is not specified by the client, the server MUST use the default value VARIANT_FALSE (0x0000) in place of the unspecified value.

Value

Meaning

VARIANT_TRUE

0xFFFF

The server MUST return an MSMQMessage object that has the DestinationQueueInfo property set.

VARIANT_FALSE

0x0000

Default. The server MUST return an MSMQMessage object that does not have the DestinationQueueInfo property set.

WantBody: A pointer to a VARIANT (VT_BOOL).

If this parameter is not specified by the client, the server MUST use the default value VARIANT_TRUE (0xFFFF) in place of the unspecified value.

Value

Meaning

VARIANT_TRUE

0xFFFF

Default. The server MUST return an MSMQMessage object that has the Body property set.

VARIANT_FALSE

0x0000

The server MUST return an MSMQMessage object that does not have the Body property set.

ReceiveTimeout: A pointer to a VARIANT that contains a long value (VT_I4) that specifies the time, in milliseconds, that the server MUST NOT exceed while waiting for a new message to arrive.

If this parameter is not specified by the client, the server MUST use the default value INFINITE (0xFFFFFFFF).

WantConnectorType: A pointer to a VARIANT (VT_BOOL).

If this parameter is not specified by the client, the server MUST use the default value VARIANT_FALSE (0x0000) in place of the unspecified value.

Value

Meaning

VARIANT_TRUE

0xFFFF

The server MUST return an MSMQMessage object that has the ConnectorTypeGuid property set.

VARIANT_FALSE

0x0000

Default. The server MUST return an MSMQMessage object that does not have the ConnectorTypeGuid property set.

ppmsg: A pointer to a pointer to an IMSMQMessage4 interface that MUST be set by the server with the received message.

Return Values: The method MUST return S_OK (0x00000000) on success or an implementation-specific error HRESULT on failure.

When processing this call, the server MUST follow these guidelines: