ModifyTime
MSMQQueueInfo

Read-only. The ModifyTime property indicates when the public queue's properties in the information store were last updated.

Type: Date Variant
Run time: read-only

Syntax

object.ModifyTime
 
Syntax Element Description
object Queue information (MSMQQueueInfo) object that defines the queue.

Return Values

Date when the queue properties were last updated (includes when the queue was created and the last time Update was called).

Remarks

To read this property, the application must first call the MSMQQueueInfo object's Refresh method. Although MSMQ updates Active Directory when the queue is created and when Update is called, the ModifyTime property is not updated until Refresh is called.

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 ModifyTime is displayed, Visual Basic automatically converts the parameter's value to the local system time and system date.

The ModifyTime property can be used when making a query (see example below).

Example

This example uses the ModifyTime and RelModifyTime parameters of LookupQueue to locate all the public queues that have been modified in the last 10 minutes. To locate the queues, MSMQ compares the date specified by the ModifyTime parameter with the date of each queue's ModifyTime property.

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. Run the example once, then wait 10 minutes and run the example again with a new PathName. The queue created by the first pass will not be found on the second pass.

Dim query As New MSMQQuery
Dim qinfos As MSMQQueueInfos
Dim qinfoNew As MSMQQueueInfo
Dim qinfoDest As MSMQQueueInfo

Private Sub Form_Click()


  Set qinfoNew = New MSMQQueueInfo
  qinfoNew.PathName = ".\ModifyTest1"
  qinfoNew.Label = "Test Queue"
  qinfoNew.Create

     
   '**********************
   ' Locate public queues
   '**********************
   dateLast = DateAdd("n", -10, Now)
   Set qinfos = query.LookupQueue(ModifyTime:=dateLast, RelModifyTime:=REL_GT)
   qinfos.Reset
   
   '**********************************
   ' Display public queues modified in
   ' last 10 minutes.
   '**********************************
   Set qinfoDest = qinfos.Next
   cQueue = 0             'Counter for number of queues found.
   
   While Not qinfoDest Is Nothing
      MsgBox "The properties of this queue (" + qinfoDest.FormatName + ") were modified in the last ten minutes."
      cQueue = cQueue + 1
      Set qinfoDest = qinfos.Next
   Wend
   
   MsgBox "The total public queues found were: " + CStr(cQueue)

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

Create, FormatName, Label, LookupQueue, MSMQQuery, MSMQQueueInfo, MSMQQueueInfos, Next, PathName, Reset