473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

EndPeek throwing MessageQueueException

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
Nov 17 '05 #1
2 2706
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

Nov 17 '05 #2
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SK | last post by:
What is the purpose of throwing exceptions in catch block. Bcos the exception is already thrown only, it is coming to the catch block.What is the purpose of throwing it again then!!!.....Help
5
by: Mark Oueis | last post by:
I've been struggling with this question for a while. What is better design? To design functions to return error codes when an error occures, or to have them throw exceptions. If you chose the...
21
by: mihai | last post by:
People say that is a bad technique to throw exception from constructors; and that the solution would be to create a function _create_ to initialize an object. What about copy constructors? How...
2
by: Tony Hamill | last post by:
Hi, I am trying to set up a VERY simple project to send message to MSMQ from ..Net using C#. When I run my code it throws an exception "An unhandled exception of type...
1
by: Farooq Khan | last post by:
i'm writing a class library having following code snippet. i want this class to report an error (by throwing an Exception) to the application using this class library. the problem is that within...
1
by: Andrew Hayes | last post by:
Hi All I've got some code that enumerates the public message queues on various remote servers and I've run into a snag.. First, here's a code snippet that is mostly working MessageQueue...
40
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
0
by: Craig | last post by:
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...
21
by: Chris M. Thomasson | last post by:
Is it every appropriate to throw in a dtor? I am thinking about a simple example of a wrapper around a POSIX file... ________________________________________________________________________ class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.