The Next method returns the next queue in the collection.
object.Next
Syntax Element | Description |
object | Collection that contains the queues. |
MSMQQueueInfo object.
For information on return codes, see MSMQ Error and Information Codes.
When the cursor is pointing to the front of the query results (for example, Reset has been called), call Next to point to the first queue in the query.
Returns NULL if the cursor is at the end of the collection (EOL).
This example assumes that at least one queue whose label is "Test Queue" already exists. It runs a query for the test queues, displaying the format name of each queue it finds.
To try this example using Microsoft® Visual Basic® (version 5.0), make sure the Microsoft Message Queue Object Library is referenced, then paste the following code into the code window of a form, run the example, then click on the form.
Dim query As New MSMQQuery Dim qinfos As MSMQQueueInfos Dim qinfo As MSMQQueueInfo Private Sub Form_Click() Set qinfos = query.LookupQueue(Label:="Test Queue") qinfos.Reset Set qinfo = qinfos.Next While Not qinfo Is Nothing MsgBox "I found a Test Queue! its Format name is: " + qinfo.FormatName Set qinfo = qinfos.Next Wend End Sub
FormatName, Label, MSMQQuery, MSMQQueueInfo, MSMQQueueInfos, Next, Reset