PeekCurrent
MSMQQueue

The PeekCurrent method returns the current message, depending on the position of the implied cursor.

When PeekCurrent is called, execution is stopped until the message is read from the queue or the receive timeout timer (ReceiveTimeout) expires.

Syntax

set object2 = object1.PeekCurrent ([ReceiveTimeout][, WantDestinationQueue][, WantBody])
 
Syntax Element Description
object1 Queue (MSMQQueue) object that represents the queue where the message resides.
object2 Message (MSMQMessage) object that represents message read from the queue.
ReceiveTimeout Optional. Specifies how long (in milliseconds) MSMQ waits for a message to arrive when the queue is empty or the cursor is pointing at the end of the queue.
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.


© 1997 by Microsoft Corporation. All rights reserved.