Partager via


Cursor Behavior When Messages are Not Available

 

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

Although the cursor may point to message location, there is no guarantee that a message is actually there. Messages may be removed by the same receiving application using another cursor, by another receiving application, by Message Queuing when a message time-out occurs, by purging the messages in the queue in Computer Management or the Active Directory Users and Computers snap-in, or the queue may be deleted.

If the receiving application tries to peek at or retrieve a message that has been removed, the cursor is no longer pointing at a message and an MQ_ERROR_MESSAGE_ALREADY_RECEIVED error is returned to the call.

More Information

For information on See
How a cursor is moved to the first message when the cursor is created. Cursor Behavior when Creating a Cursor
How the cursor is moved when peeking at messages Cursor Behavior when Peeking at Messages
How the cursor is moved when retrieving messages Cursor Behavior when Retrieving Messages
How the cursor is moved when reaching the end of the queue Cursor Behavior when Reaching the End of the Queue
How multiple cursors interact Cursor Behavior when Using Multiple Cursors
How the cursor behaves when waiting for new messages at the end of the queue. Cursor Behavior when Waiting for New Messages
How the behaves when errors occur. Cursor Behavior Due to Errors
How the cursor behaves when trying to read messages from a deleted queue Cursor Behavior and Deleted Queues
How the cursor moves when the queue contains messages with different message priority levels. Cursor Behavior and Message Priority
Summary of COM methods that use cursors for synchronous and asynchronous operations Cursors and COM Components
Example code that navigates a queue based on cursors. Navigating Queue Examples