MQDeleteQueue

The MQDeleteQueue function deletes a queue from MQIS (in the case of public queues), or from the local computer (in the case of private queues).

HRESULT APIENTRY MQDeleteQueue(
  LPCWSTR lpwcsFormatName  
);
 

Parameters

lpwcsFormatName
[in] Pointer to the queue's format name buffer. This buffer contains the format name string of the queue to be deleted.

Return Values

MQ_OK
Indicates success.
MQ_ERROR_ACCESS_DENIED
The process does not have the access rights to delete this queue. To change access rights, call MQSetQueueSecurity.
MQ_ERROR_ILLEGAL_FORMATNAME
The specified format name in lpwcsFormatName is illegal.
MQ_ERROR_NO_DS
No connection with the Site Controller server. Cannot access the MQIS.
MQ_ERROR_SERVICE_NOT_AVAILABLE
Cannot connect to the Queue Manager.
MQ_ERROR_UNSUPPORTED_FORMATNAME_OPERATION
Cannot delete a queue using a direct format name.
MQ_ERROR_WRITE_NOT_ALLOWED
Cannot delete a queue from MQIS while an MSMQ information store server is being installed.

Remarks

The format name of the queue (specified by lpwcsFormatName) cannot be a direct format name.

When deleting public queues, some clients may still see the queue registered in MQIS after the queue was deleted. Changes to MQIS (such as deleting a public queue) are propagated from site to site, which can cause delays in the availability of current information. Consequently, clients in some sites may still try to send messages to the queue, even though it was deleted. Propagation delays, including communication network delays such as down links, are controlled by the MSMQ Administrator.

Public queues cannot be deleted by independent client computers running offline. For information on offline operations, see MSMQ Offline Support.

Examples

For an example of using MQDeleteQueue, see Deleting a Queue.

See Also

MQCloseQueue, MQCreateQueue, MQOpenQueue, MQSetQueueSecurity


© 1997 by Microsoft Corporation. All rights reserved.