F
felecha
I have been developing an app in VB.Net, using a simple form and a
button to kick off a class that starts asynchronously receiving from
a MessageQueue. It's been working fine, but now I'm moving toward
converting it to a Windows Service, so I switched from instantiating
the clsMsgReceiver class at the Button_Click to a simple Main() that
does the same thing.
I'm stumped -- when started from Main(), the BeginReceive() works only
if there is a message waiting in the MessageQueue when it starts. It
will then process all the messages until the MessageQueue is empty,
and continue waiting for further messages. But if the MessageQueue
is empty when the BeginReceive() starts, it throws an exception. I
tried looking at the MessageQueueErrorCode in the Catch, and it says
" -1073741536". I can see the Enumeration for the error code, but
have not found any way to find out which one of the many errors is
-1073741536.
How do I get that, and better yet, any idea why it would work
correctly when called from a Form button but not from Main()?
button to kick off a class that starts asynchronously receiving from
a MessageQueue. It's been working fine, but now I'm moving toward
converting it to a Windows Service, so I switched from instantiating
the clsMsgReceiver class at the Button_Click to a simple Main() that
does the same thing.
I'm stumped -- when started from Main(), the BeginReceive() works only
if there is a message waiting in the MessageQueue when it starts. It
will then process all the messages until the MessageQueue is empty,
and continue waiting for further messages. But if the MessageQueue
is empty when the BeginReceive() starts, it throws an exception. I
tried looking at the MessageQueueErrorCode in the Catch, and it says
" -1073741536". I can see the Enumeration for the error code, but
have not found any way to find out which one of the many errors is
-1073741536.
How do I get that, and better yet, any idea why it would work
correctly when called from a Form button but not from Main()?