MSMQQueue

 

Updated: July 19, 2016

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.

The MSMQQueue object defines the following methods.

MethodDescription
MSMQQueue.CloseCloses this instance of the queue.
MSMQQueue.EnableNotificationStarts event notification for asynchronously reading messages in the queue.
MSMQQueue.PeekReturns 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.PeekCurrentReturns 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.PeekNextReturns 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.ReceiveRetrieves 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.ReceiveCurrentReads 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.ResetReturns the cursor to the start of the queue.

The MSMQQueue object defines the following properties.

PropertyDescription
MSMQQueue.AccessProvides the access mode in which the queue was opened.

Run-time access: Read-only

Data type: Long
MSMQQueue.HandleProvides 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.QueueInfoProvides an MSMQQueueInfo object that contains the initial settings used to open the queue.

Run-time access: Read-only

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

Run-time access: Read-only

Data type: Long

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.

Message Queuing COM Components
MSMQQueueInfo
MSMQQueueInfo.Create
MSMQQueueInfo.Open

Community Additions

ADD
Show: