Compartilhar via


MSMQApplication.Tidy

 

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

(Introduced in MSMQ 3.0.) The Tidy method of the MSMQApplication object cleans up empty message files.

Sub Tidy
()  

Parameters

This method has no parameters.

Return Values

This method has no return values.

Error Codes

This method generates one of the following error codes:

MQ_OK (0)

The method call was successful.

MQ_ERROR_ACCESS_DENIED (0xC00E0025)

The access rights for performing management actions on the computer are not allowed for the calling process.

MQ_ERROR_SERVICE_NOT_AVAILABLE (0xC00E000B)

The application is unable to connect to the queue manager.

For a complete list of error and information codes, see Message Queuing Error and Information Codes.

Remarks

Including the MSMQApplication object in the code syntax is optional because this object is defined as the application object, whose methods and properties are globally available.

This method cleans up empty message files, regardless of the automatic cleanup interval used by Message Queuing. Message Queuing automatically cleans up empty message files based on its default six hour cleanup interval or based on the MessageCleanupInterval registry value.

This method (by default) applies to the local computer. To reference another computer, set MSMQApplication.Machine to another computer and call this method again.

Local administrative permissions are needed to clean up the empty message files on a computer.

In C++ COM applications, you must use a smart pointer to the IMSMQApplication3 interface to expose the Tidy method.

Equivalent API Function

When using API functions, call MQMgmtAction and pass "TIDY" as the string indicating the action to be performed on the computer to clean up empty message files.

Requirements

Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQApplication
MSMQApplication.Machine