ReceiveCurrent
MSMQQueue

The ReceiveCurrent method reads the message at the current cursor location.

Syntax

set object2 = object1.ReceiveCurrent ([ReceiveTimeout][, pTransaction][, WantDestinationQueue][, WantBody])
 
Syntax Element Description
object1 Queue (MSMQQueue) object that represents the open instance of the queue that is receiving messages.
object2 Message (MSMQMessage) object that represents the message retrieved from the queue.
ReceiveTimeout Optional. Specifies how long (in milliseconds) MSMQ waits for a message to arrive.
pTransaction Optional. An MSMQTransaction object or one of the following constants:

MQ_NO_TRANSACTION: Specifies that the call is not part of a transaction.

MQ_MTS_TRANSACTION: Default. Specifies that the call is part of the current MTS (Microsoft Transaction Server) transaction.

MQ_XA_TRANSACTION: Specifies that the call is part of an externally coordinated, XA-compliant transaction.

WantDestinationQueue Optional (default is FALSE). If TRUE, DestinationQueueInfo is updated when the message is read from the queue. Setting this property to TRUE may slow down the operation of the application.
WantBody Optional (default is TRUE). If the Body of the message is not needed, set this property to FALSE to optimize the speed of the application.

Return Values

MSMQMessage object.

Remarks

The pTransaction parameter can be set to an MSMQTransaction object or one of the constants described above. For information on the different types of transactions the MSMQ supports, see:

QuickInfo

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