EndPeek throwing MessageQueueException

Discussion in 'Microsoft C# .NET' started by Craig, Sep 13, 2005.

  1. Craig

    Craig Guest

    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
     
    Craig, Sep 13, 2005
    #1
    1. Advertisements

  2. Craig

    Guest 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

    "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
    >
    >
    >
     
    Guest, Sep 13, 2005
    #2
    1. Advertisements

  3. Craig

    Craig Guest

    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" <> wrote in message
    news:D...
    > 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
    >>
    >>
    >>
     
    Craig, Sep 14, 2005
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. namri
    Replies:
    2
    Views:
    499
    Ignacio Machin
    Jul 11, 2003
  2. Kyle Silvers

    (proverbially) Throwing Myself to the C# Wolves

    Kyle Silvers, Jul 11, 2003, in forum: Microsoft C# .NET
    Replies:
    5
    Views:
    489
    David
    Jul 18, 2003
  3. Tony Hamill
    Replies:
    2
    Views:
    1,028
    Tony Hamill
    Oct 29, 2003
  4. Guest

    MessageQueueException in ReadHandle

    Guest, Feb 26, 2004, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    965
    Yoel Arnon [MSFT]
    Feb 26, 2004
  5. Craig
    Replies:
    0
    Views:
    749
    Craig
    Sep 14, 2005
Loading...

Share This Page