EndPeek throwing MessageQueueException

C

Craig

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
 
G

Guest

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
 
C

Craig

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top