MQCloseQueue

The MQCloseQueue function closes a given queue.

HRESULT APIENTRY MQCloseQueue(
  QUEUEHANDLE hQueue  
);
 

Parameters

hQueue
[in] Handle to the queue you want to close.

Return Values

MQ_OK
Indicates success.
MQ_ERROR_INVALID_HANDLE
The queue handle specified in hQueue is not valid.

Remarks

When an application closes a queue, the queue handle becomes invalid, but the messages waiting in the queue remain in the queue. These includes any messages sent to the queue by the application closing the queue.

When MQCloseQueue is called, any cursors created for the queue are also closed.

Examples

For an example of using MQCloseQueue, see:

See Also

MQOpenQueue


© 1997 by Microsoft Corporation. All rights reserved.