CreateTime
MSMQQueueInfo

Read-only. The CreateTime property indicates when the public queue was created.

Type: Date Variant
Run time: read-only

Syntax

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

Return Values

Date when queue was created.

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

The CreateTime property can also be used when making a query. See the MSMQQuery object's LookupQueue method for details on running a query.

Example

This example uses the CreateTime and RelCreateTime parameters of LookupQueue to locate all the public queues. To locate the queues, MSMQ compares the date specified by the CreateTime parameter with the date of each queue's CreateTime 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.

Dim query As New MSMQQuery
Dim qinfos As MSMQQueueInfos
Dim qinfoDest As MSMQQueueInfo
Dim queueCount As Integer

Private Sub Form_Click()
     
   '**********************
   ' Locate public queues
   '**********************
   Set qinfos = query.LookupQueue(CreateTime:=Now, RelCreateTime:=REL_LT)
   qinfos.Reset
   
   '******************************************
   ' Display create time of all public queues.
   '******************************************
   Set qinfoDest = qinfos.Next
   queueCount = 0             'Counter for number of queues found.
   
   While Not qinfoDest Is Nothing
      MsgBox "This public queue (" + qinfoDest.Label + ") was created on: " + CStr(qinfoDest.CreateTime)
      queueCount = queueCount + 1
      Set qinfoDest = qinfos.Next
   Wend
   
   MsgBox "The total public queues found were: " + CStr(queueCount)

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

Label, LookupQueue, MSMQQuery, MSMQQueueInfo, MSMQQueueInfos, Next, Reset