Поделиться через


MSMQQueueInfo.Refresh

 

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 Refresh method of the MSMQQueueInfo object refreshes the property values of the MSMQQueueInfo object. These values are retrieved from the directory service (public queues) or from the local computer (private queues).

Sub Refresh
()  

Parameters

This method has no parameters.

Return Values

This method has no return values.

Error Codes

For information on return codes, see Message Queuing Error and Information Codes.

Remarks

After an MSMQQueueInfo object is initialized (or re-initialized) to point to a specific queue by setting its MSMQQueueInfo.FormatName or MSMQQueueInfo.PathName property, use Refresh to retrieve the stored properties of the queue. Also use Refresh to retrieve the stored format name and other properties of a queue represented by the query-generated MSMQQueueInfo object.

All queue properties can be retrieved. However, you can retrieve the properties of private queues only if they are located on your local computer.

Refresh is also used when more than one user is using the queue. For example, if user 1 locates the queue and then user 2 modifies the queue's properties, user 1 needs to call Refresh to sync up with user 2's changes.

After a queue is created, the properties of the MSMQQueueInfo object are not updated until Refresh is explicitly called, or the queue is closed and reopened. For example, even though Message Queuing sets MSMQQueueInfo.CreateTime, MSMQQueueInfo.ModifyTime, or MSMQQueueInfo.QueueGuid when it creates the queue, the application must call Refresh to update the properties of the MSMQQueueInfo object before it can read those properties.

Equivalent Function

With function calls, the equivalent function is MQGetQueueProperties.

Example Code

The following example is included in Using Message Queuing.

For an example of See
Retrieving the properties of an existing queue Changing Queue Behavior Examples

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

MQGetQueueProperties
MSMQQueueInfo