다음을 통해 공유


MSMQQueue

 

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 MSMQQueue object represents an open instance of a queue that is represented by an MSMQQueueInfo object. The MSMQQueue object provides the methods needed to read and delete the messages in the queue and the properties needed to manage the open queue.

For information on opening the queue, see the MSMQQueueInfo.Open method.

Methods

The MSMQQueue object defines the following methods.

Method Description
MSMQQueue.Close Closes this instance of the queue.
MSMQQueue.EnableNotification Starts event notification for asynchronously reading messages in the queue.
MSMQQueue.Peek Returns the first message in the queue, or waits for a message to arrive if the queue is empty.
MSMQQueue.PeekByLookupId (Introduced in MSMQ 3.0.) Returns the message referenced by the supplied lookup identifier.
MSMQQueue.PeekCurrent Returns the current message at the current cursor position and moves the cursor to the next message, or waits for a message to arrive.
MSMQQueue.PeekFirstByLookupId (Introduced in MSMQ 3.0.) Returns the first message in the queue.
MSMQQueue.PeekLastByLookupId (Introduced in MSMQ 3.0.) Returns the last message in the queue.
MSMQQueue.PeekNext Returns the next message in the queue but does not remove it from the queue.
MSMQQueue.PeekNextByLookupId (Introduced in MSMQ 3.0.) Returns the message that follows the message referenced by the supplied message lookup identifier.
MSMQQueue.PeekPreviousByLookupId (Introduced in MSMQ 3.0.) Returns the message that precedes the message referenced by the supplied message lookup identifier.
MSMQQueue.Purge (Introduced in MSMQ 3.0) Deletes all the messages in the queue.
MSMQQueue.Receive Retrieves the first message in the queue, removing the message from the queue.
MSMQQueue.ReceiveByLookupId (Introduced in MSMQ 3.0.) Retrieves the message referenced by the supplied lookup identifier and removes the message from the queue.

Used when navigating the queue using lookup identifiers.
MSMQQueue.ReceiveCurrent Reads the message at the current cursor location.
MSMQQueue.ReceiveFirstByLookupId (Introduced in MSMQ 3.0.) Returns the first message in the queue and removes the message from the queue.
MSMQQueue.ReceiveLastByLookupId (Introduced in MSMQ 3.0.) Returns the last message in the queue and removes the message from the queue.

Used when navigating the queue using lookup identifiers.
MSMQQueue.ReceiveNextByLookupId (Introduced in MSMQ 3.0.) Returns the message that follows the message referenced by the supplied message lookup identifier and removes the message from the queue.

Used when navigating the queue using lookup identifiers.
MSMQQueue.ReceivePreviousByLookupId (Introduced in MSMQ 3.0.) Returns the message that precedes the message referenced by the supplied message lookup identifier and removes the message from the queue.

Used when navigating the queue using lookup identifiers.
MSMQQueue.Reset Returns the cursor to the start of the queue.

Properties

The MSMQQueue object defines the following properties.

Property Description
MSMQQueue.Access Provides the access mode in which the queue was opened.

Run-time access: Read-only

Data type: Long
MSMQQueue.Handle Provides the handle of the opened queue.

Run-time access: Read-only

Data type: Long
MSMQQueue.IsOpen (Superseded by IsOpen2.) Provides an indicator of whether the queue is open.

Run-time access: Read-only

Data type: Short
MSMQQueue.IsOpen2 (Introduced in MSMQ 3.0.) Provides an indicator of whether the queue is open.

Run-time access: Read-only

Data type: Boolean
MSMQQueue.QueueInfo Provides an MSMQQueueInfo object that contains the initial settings used to open the queue.

Run-time access: Read-only

Data type: MSMQQueueInfo
MSMQQueue.ShareMode Provides the share mode in which the queue was opened.

Run-time access: Read-only

Data type: Long

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

Message Queuing COM Components
MSMQQueueInfo
MSMQQueueInfo.Create
MSMQQueueInfo.Open