| Previous | Next |
| MQ_ERROR_INVALID_HANDLE | MQ_ERROR_SHARING_VIOLATION |
MQ_ERROR_OPERATION_CANCELLED
MQ_ERROR_OPERATION_CANCELLED means that Message Queuing stopped the operation before completion. Microsoft gives the example of a thread closing a queue handle while another thread is waiting to receive a message.
How to investigate
- Treat cancellation as a terminal completion for the pending receive or lookup operation, not as a message-delivery failure.
- Coordinate queue shutdown with threads that are blocked in receive or are using asynchronous completion.
- Use a new queue handle for later work after the cancellation path has drained the old operation.
Microsoft: MQReceiveMessageByLookupId return values
Looking for a different code? Search another status or error code.