Ok, for MessageQueue, use the MessageQueueErrorCode property of the
MessageQueueException.
The error code -1072824317 is actually MessageQueueErrorCode.QueueNotFound.
So you can find this specific case as
if (MessageQueueException.MessageQueueErrorCode ==
MessageQueueErrorCode.QueueNotFound)
{
}
Or if you prefer numeric value comparison,
if (-1072824317 == (int)MessageQueueErrorCode.QueueNotFound)
{
}
"Paw Pedersen" <ne**@paws.dk> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
I'm not sure how to do that.
Now I catch it as a System.Messaging.MessageQueueException and there aren't
any NativeErrorCode property on that. I have tried to catch it as
Win32Exception, but it doesn't catch the exception then.
I have also tried to cast the MessageQueueException to a Win32Exception but
that gives an invalid cast exception.
Could you give an example?
Thanks Paw
"Shiva" <sh******@online.excite.com> wrote in message
news:eU**************@TK2MSFTNGP11.phx.gbl...
Hi,
It is a property of Win32Exception. So, you have to catch it explictly and
access the native error code.
HTH
"Paw Pedersen" <ne**@paws.dk> wrote in message
news:#T**************@TK2MSFTNGP11.phx.gbl...
When I catch an exception I can see the NativeErrorCode when I'm debugging
through the code, but how do I get this programatically?
I need to check if the exception I catch is with
nativeErrorCode -1072824317 since this is the only error I'm interestet
in.
Thanks in advance
Paw