Partager via


Reading Messages Using a Cursor (COM) (Windows Embedded CE 6.0)

1/6/2010

When reading messages using a cursor, the receiving application can navigate to any number of messages in the queue.

The following example navigates through the queue, displaying the label of each message it finds.

Note

Cursors can be used when reading messages synchronously or asynchronously.

To read messages using a cursor

  1. Declare the objects needed to read the messages.

  2. Obtain a QueueInfo object.

  3. Open the queue with receive or peek access.

  4. Call MSMQQueue.PeekCurrent to point the cursor to the first message in the queue.

  5. Using a loop structure, call MSMQQueue.PeekNext to move the cursor and read all the messages in the queue.

  6. Call MSMQQueue.Close to close the queue.

See Also

Concepts

Reading Messages in a Queue (COM)
MSMQ COM Support
Using the COM Components
MSMQ Security

Other Resources

Message Queuing