Partager via


MSMQQueueInfo.CreateTime

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The CreateTime property of the MSMQQueueInfo object indicates when the public queue or private queue (introduced in MSMQ 2.0) was created.

Data type: Variant (Date)
Run-time access: Read-only
Property CreateTime As Variant  

Property Value

A Variant of subtype Date containing the date and time when the queue was created.

Remarks

Message Queuing sets this property, storing the value of the property when the queue is created. Once retrieved, the value of CreateTime 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 property value to the local system time and system date.

The CreateTime property can be used as search criteria when making a query of existing public queues. See the MSMQQuery.LookupQueue method for details on running a query.

To retrieve the CreateTime property of a queue, your application must first obtain an MSMQQueueInfo object that represents the queue. This object can be returned by a query using the MSMQQuery.LookupQueue method or created by the sending or receiving application.

Before using an application-created MSMQQueueInfo object, the application must initialize it to reference the queue by setting its MSMQQueueInfo.PathName or MSMQQueueInfo.FormatName property. For public queues, setting the FormatName property with a cached public format name instead of the PathName property frees Message Queuing from the need to retrieve information stored in the directory service to generate this format name. Direct format names can be used only for local private queues.

To retrieve the stored create time of a queue, call the MSMQQueueInfo.Refresh method and inspect the CreateTime property. Message Queuing stores the create time in the directory service (for public queues) and on the local computer (for private queues). The property values of the MSMQQueueInfo object are not updated with the values stored by Message Queuing until the MSMQQueueInfo.Refresh method is called.

Equivalent API Function Property

With function calls, the equivalent property is PROPID_Q_CREATE_TIME.

Example Code

The following example is included in Using Message Queuing.

For an example of See
Retrieving the date and time when an existing queue was created Visual Basic Code Example: Retrieving MSMQQueueInfo.CreateTime

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQQuery
MSMQQuery.LookupQueue
MSMQQueueInfo
MSMQQueueInfo.Refresh
PROPID_Q_CREATE_TIME