By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,152 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,152 IT Pros & Developers. It's quick & easy.

Sudden Application Close

P: n/a
hi, I'm using the vs2003...

I don't know what is going on... everytime my application connects to a
device that I have, i do the connection and disconnection sucessfully but
after a while, and only sometimes (it's a random error) the application
closes... does not give any error and there isn't any exception, nothing... I
can't figure how to trace what is going on... there is nothing wrong?

Do you know any way to get around it?
Apr 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Diogo,

Are you doing anything on a thread perhaps? If so, can you wrap that
code in a try/catch block and see what it is? If there is an error on the
UI thread, then you should definitely see a message, but not necessarily on
another thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:32**********************************@microsof t.com...
hi, I'm using the vs2003...

I don't know what is going on... everytime my application connects to a
device that I have, i do the connection and disconnection sucessfully but
after a while, and only sometimes (it's a random error) the application
closes... does not give any error and there isn't any exception,
nothing... I
can't figure how to trace what is going on... there is nothing wrong?

Do you know any way to get around it?

Apr 4 '06 #2

P: n/a
VJ
Attach the below events in your main.

AppDomain.CurrentDomain.UnhandledException+=new
UnhandledExceptionEventHandler(CurrentDomain_Unhan dledException);
Application.ThreadException+=new
ThreadExceptionEventHandler(Application_ThreadExce ption);

Examine if you get any errors here... using the EventArgs..

VJ

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:32**********************************@microsof t.com...
hi, I'm using the vs2003...

I don't know what is going on... everytime my application connects to a
device that I have, i do the connection and disconnection sucessfully but
after a while, and only sometimes (it's a random error) the application
closes... does not give any error and there isn't any exception,
nothing... I
can't figure how to trace what is going on... there is nothing wrong?

Do you know any way to get around it?

Apr 4 '06 #3

P: n/a
VJ
Forgot this .. you have to add the events before the Application.Run, in
your main.. and declare the events as static... So you catch globally any
exception thrown...Remember this wont catch exception thrown from secondary
threads....

VJ

"VJ" <vi********@yahoo.com> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
Attach the below events in your main.

AppDomain.CurrentDomain.UnhandledException+=new
UnhandledExceptionEventHandler(CurrentDomain_Unhan dledException);
Application.ThreadException+=new
ThreadExceptionEventHandler(Application_ThreadExce ption);

Examine if you get any errors here... using the EventArgs..

VJ

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:32**********************************@microsof t.com...
hi, I'm using the vs2003...

I don't know what is going on... everytime my application connects to a
device that I have, i do the connection and disconnection sucessfully but
after a while, and only sometimes (it's a random error) the application
closes... does not give any error and there isn't any exception,
nothing... I
can't figure how to trace what is going on... there is nothing wrong?

Do you know any way to get around it?


Apr 4 '06 #4

P: n/a
Hi,

"VJ" <vi********@yahoo.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
...Remember this wont catch exception thrown from secondary threads....


What you use Application.ThreadException for ?

IIRC it does gets an notification when a thread throw an exception, no
matter what thread.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Apr 4 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.