Share via


Reading Messages from a Dead-Letter Queue (COM)

A version of this page is also available for

Windows Embedded CE 6.0 R3

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

  1. Declare the variables needed to retrieve the message.

  2. Call MSMQApplication.MachineIdOfMachineName to obtain the machine identifier.

  3. Construct the format name of the dead-letter queue.

  4. Declare the variables needed to retrieve the message.

  5. Call MSMQQueueInfo.Open to open the queue with receive access.

  6. Call MSMQQueue.Receive to retrieve the first message in the queue.

  7. Call MSMQQueue.Close to close the dead-letter queue.

See Also

Concepts

MSMQ COM Support
Using the COM Components
MSMQ Security

Other Resources

Message Queuing