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

Thrown Error NOT Caught!?

Here is the problem.
I'm opening a form that Throw's an error in the Load event and the method
thant opens the form has a try..Catch to Catch the error that is thrown in
the load event.

This works fine running through the design-time enviroment. But if I run
the .EXE it says Unhandled Exception and quits. WHY?

How do I fix this???

Nick
Nov 21 '05 #1
4 1437
"chopsnsauce" <ch*********@discussions.microsoft.com> schrieb:
I'm opening a form that Throw's an error in the Load event and the method
thant opens the form has a try..Catch to Catch the error that is thrown
in
the load event.

This works fine running through the design-time enviroment. But if I run
the .EXE it says Unhandled Exception and quits. WHY?


Take a look at 'Application.ThreadException' in the documentation.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Well that gives me a work round. But I want the method that opens the form
to catch the exception.

Like I said, when I run my App through the IDE the exceception is caught.
When I run the EXE the exception is unhadles. I want the EXE to catch the
exception as well. Its the same code so why should it behave differently??

Regards,

Nick

"Herfried K. Wagner [MVP]" wrote:
"chopsnsauce" <ch*********@discussions.microsoft.com> schrieb:
I'm opening a form that Throw's an error in the Load event and the method
thant opens the form has a try..Catch to Catch the error that is thrown
in
the load event.

This works fine running through the design-time enviroment. But if I run
the .EXE it says Unhandled Exception and quits. WHY?


Take a look at 'Application.ThreadException' in the documentation.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
I believe this is the result of a bug. The IDE handles catching the
exception differently somehow. There was a discussion about this in
the last few weeks on this group.

Nov 21 '05 #4
Do you have a link to this?

Nick

"Chris Dunaway" wrote:
I believe this is the result of a bug. The IDE handles catching the
exception differently somehow. There was a discussion about this in
the last few weeks on this group.

Nov 21 '05 #5

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

Similar topics

1
by: Jorge Cecílio | last post by:
Hi all! I've a (beginner) problem accessing a method on another class. When I execute a method such as: //response to a swing button public void actionPerformed(ActionEvent event) {
9
by: fabio de francesco | last post by:
Hi, I would like to know why objects that are thrown to be caught are copy-constructed more than once. I have seen this behaviour after running the following simple program that is an...
5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
10
by: Cool Guy | last post by:
Consider: void Start() { if (!TryToDoSomething()) ShowErrorMessage(); }
5
by: Mark Kamoski | last post by:
Hi Everyone-- How can one get the line number of where an error was thrown and/or caught? For example, note the following, for use at any given point in a piece of code: ....to get the...
4
by: Michael Rodriguez | last post by:
I have a data layer in a dll class. If I manually throw an exception in that data layer, the generic Application.OnThreadException in my UI does not catch it nor does it display any message...
7
by: Chris | last post by:
Hello all... I have a program with the following structure (all classes mentioned are of my own creation, and none of the classes contain try or catch blocks): - main() consists of a large...
4
by: Terry Olsen | last post by:
I have a class where I throw a new exception from a method My calling code (in a different class) is wrapped in a Try/Catch block, but it's not catching. Instead the IDE is highlighting the...
1
by: pasu | last post by:
I'm getting the error Exception thrown and not caught...and showing the line number too.but nothing i've wrote on that line......greatly confusing...kindly help me....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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.