다음을 통해 공유


Cursor Behavior when Creating a Cursor

 

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

Before a cursor can be used, the cursor must be created and moved to the first message location in the queue.

Note

Cursors point to message location, not to specific messages).

Cursors are created in two ways, depending on the type of calls used by the receiving application. When using function calls, the receiving application must create the cursor by calling the MQCreateCursor function. When using COM components, Message Queuing automatically creates a cursor when the queue is opened.

After the cursor is created, the receiving application must explicitly move the cursor to the first message location in the queue (even if there are no messages in the queue) by calling MQReceiveMessage with dwAction set to MQ_ACTION_PEEK_CURRENT. The illustration below shows the function and method call used to move the cursor to the first message location.

<No Change>

More Information

For information on See
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 cursor behaves when trying to read a message that was removed by someone else. Cursor Behavior When Messages are Not Available
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