ArrivedTime
MSMQMessage

Read-only. The ArrivedTime property indicates when the message arrived at the queue.

Type: Date Variant
Run time: read-only

Syntax

object.ArrivedTime
 
Syntax Element Description
object Message (MSMQMessage) object that defines the message.

Return Values

Date and time when message arrived.

Remarks

The returned value for this property can be manipulated using standard Microsoft® Visual Basic® date and time functions such as Date$ and Time$. For descriptions of Visual Basic functions, see the Visual Basic documentation.

When reading messages from a journal queue, ArrivedTime indicates when the original message reached its queue, not when the original message was removed from the queue and a copy placed in the journal queue.

When reading messages from a machine journal, dead letter queue, or transactional dead letter queue, ArrivedTime indicates when the message reached the system queue where the application is reading the message. In these cases, the original message never reached its destination.

When ArrivedTime is displayed, Visual Basic automatically converts the parameter value to the local system time and system date.

Example

This example locates a destination queue (creating one if one does not exist), sends a message to the queue, reads the message, and displays when the message arrived in the queue.

To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, run the example, and click the form.

Dim query As New MSMQQuery
Dim qinfos As MSMQQueueInfos
Dim qinfoDest As MSMQQueueInfo
Dim qDest As MSMQQueue
Dim msgSent As New MSMQMessage
Dim msgRead As MSMQMessage


Private Sub Form_Click()
   
   
   '**********************************
   ' Locate destination queue
   '(create one if one doesn't exist).
   '**********************************
   Set qinfos = query.LookupQueue(Label:="Destination Queue")
   qinfos.Reset
   Set qinfoDest = qinfos.Next
   If qinfoDest Is Nothing Then
      Set qinfoDest = New MSMQQueueInfo
      qinfoDest.PathName = ".\DestQueue"
      qinfoDest.Label = "Destination Queue"
      qinfoDest.Create
   End If
   
   '**************
   ' Send Message.
   '**************
   Set qDest = qinfoDest.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)
   msgSent.Label = "Test Message"
   msgSent.Body = "This message tests the message timers."
   msgSent.Send qDest
   qDest.Close
        
   '************************************
   ' Remove the message from destination
   ' queue and display when the message arrived.
   '************************************
   Set qDest = qinfoDest.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)
   Set msgRead = qDest.Receive
   
   MsgBox "The message arrived at: " + CStr(msgRead.ArrivedTime)
    
End Sub
 

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.

See Also

Body, Close, Create, Label, LookupQueue, MSMQMessage, MSMQQuery, MSMQQueue, MSMQQueueInfo, MSMQQueueInfos, Next, Open, PathName, Receive, Send