Hi Dan.
Thank you for your reply, I appreciate your assistance. The error code for
the MessageQueueException is -1073741536 and the message is blank. I tried
to match up which MessageQueueErrorCode it is, but looks as though there's
no match. Do you have any idea what could be wrong?
--begin
[ErrCode:-1073741536] ''
System.Messaging.MessageQueueException
at System.Messaging.AsynchronousRequest.End()
at System.Messaging.MessageQueue.EndPeek(IAsyncResult asyncResult)
--end
Thanks and best regards.
Craig
"Dan Kelley" <Da*******@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
It is impossible to say without knowing more details on the exception. My
suggestion would be, when you catch the MessageQueueException, take a look
at
the Message and MessageQueueErrorCode properties.
These should give you an idea of what is going wrong.
HTH
Dan
"Craig" wrote:
Hi,
Would appreciate any help you guys have to offer. On calling beginPeek on
instantiation of a MessageQueue, EndPeek throws a MessageQueueException.
If
the queue exists already, the exception is not thrown, but when I just
create the queue and call BeginPeek, the exception is thrown. Any ideas?
//begin code
if(!MessageQueue.Exists(_messageQueuePath)) {
MessageQueue tempMQ = MessageQueue.Create(_messageQueuePath,
true);
tempMQ.SetPermissions(_windowsSecurityAccount,
MessageQueueAccessRights.FullControl);
}
_myQueue = new MessageQueue(_messageQueuePath);
_myQueue.Formatter = new BinaryMessageFormatter();
_myQueue.PeekCompleted += new
PeekCompletedEventHandler(m_myQueue_PeekCompleted) ;
_myQueue.BeginPeek();
//end code
Thank you.
Craig