| Previous | Next |
| MQ_ERROR_INVALID_PARAMETER | MQ_ERROR_OPERATION_CANCELLED |
MQ_ERROR_INVALID_HANDLE
MQ_ERROR_INVALID_HANDLE means that the queue handle passed to Message Queuing is not valid for the requested operation. This commonly points to a handle that was never opened successfully, was already closed, or belongs to a different lifetime than the current operation.
How to investigate
- Pair every successful
MQOpenQueuecall with one owner responsible forMQCloseQueue. - Prevent another thread from closing the handle while receive, peek, or asynchronous completion processing is still active.
- Open a fresh queue handle after a service restart or queue recreation instead of reusing cached state.
Microsoft: MQReceiveMessageByLookupId return values
Looking for a different code? Search another status or error code.