Reading Messages from a Dead-Letter Queue (COM)
A version of this page is also available for
4/8/2010
To read non-transactional messages from a dead-letter queue you must first obtain the machine identifier (GUID) of the computer associated with the DEADLETTER.
The machine identifier is combined with the "Machine" and "DEADLETTER" keywords to create the format name of the queue. Here is the syntax of format name for the dead-letter queue.
Machine=MachineGUID;DEADLETTER
To retrieve a message from a dead-letter queue
Declare the variables needed to retrieve the message.
Call MSMQApplication.MachineIdOfMachineName to obtain the machine identifier.
Construct the format name of the dead-letter queue.
Declare the variables needed to retrieve the message.
Call MSMQQueueInfo.Open to open the queue with receive access.
Call MSMQQueue.Receive to retrieve the first message in the queue.
Call MSMQQueue.Close to close the dead-letter queue.
See Also
Concepts
MSMQ COM Support
Using the COM Components
MSMQ Security