MessageQueue GetAllMessages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am tying to get all of the messages in a MessageQueue using GetAllMessages
but it not only is taking a long time but eventually I get:

There are 2 messages in the failed queue.

failed: System.Messaging.MessageQueueException : Invalid parameter was
passed to a function.
at System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout)
at System.Messaging.MessageEnumerator.MoveNext()
at System.Messaging.MessageQueue.GetAllMessages()

First I want to know how many object are in the queue (without changing it).
Next I want to get all of the objects from the queue (without changing it).

Apparently GetAllMessages() is not the way to do this. Any suggestions?

Thank you.

Kevin
 
Back
Top