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 time-out timer (ReceiveTimeout) expires.
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 the 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. |
MSMQMessage object.
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.