473,385 Members | 1,798 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,385 software developers and data experts.

Sudden Application Close

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
4 1750
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ITMA | last post by:
When I go to close a Query to which I have made changes, I get prompted to save it, I say yes, and then Access suddenly closes itself down and when I reopen the database the Query has not been...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
1
by: branton ellerbee | last post by:
Cookie problem in .aspx application. I have a cookie problem that makes no sense. I get this error when the page loads: Object reference not set to an instance of an object. I am reading...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
1
by: Henrik | last post by:
I have a problem with processor load in the enviroment where I'm running the firts installation of my new application. My program is running on a Pentium 4 3.0 GHz, wtih 1 GB DDR SDRAM and 80 GB...
11
by: skishorev | last post by:
Hi, In sudden power off, How to backup means in which format(files, streams) & when to backup in C. Thanks, SAI
0
by: =?Utf-8?B?TWF0dCBDYWxob29u?= | last post by:
Hi there, Have had Team Foundation Server working for months now and all of a sudden after a restart of IIS it has been failing with errors: The identity of application pool 'TFS AppPool' is...
1
by: rajayan | last post by:
Jochen Kalmbach wrote: Thank you for your reply. Yes we do. Could you please elaborate. Are you referring to the CString::AllocBuffer related hangs or sudden crashes --
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.