Reading Messages Using a Cursor (COM) (Windows CE 5.0)
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
- Declare the objects needed to read the messages.
- Obtain a QueueInfo object.
- Open the queue with receive or peek access.
- Call MSMQQueue.PeekCurrent to point the cursor to the first message in the queue.
- Using a loop structure, call MSMQQueue.PeekNext to move the cursor and read all the messages in the queue.
- Call MSMQQueue.Close to close the queue.
See Also
MSMQ Application Development | MSMQ COM Support | Using the COM Components | MSMQ Security
Send Feedback on this topic to the authors