Kasracer
Jan 6th, 2004, 01:57 PM
I need a dynamic array, so I am using an ArrayList, however, I need it to contain Exceptions. I can add Exceptions to it fine, however, using them and trying to return just 1 of them (i.e. return ArrayList1[0]) is a problem.
When I add an Exception to the ArrayList, it converts it to an Object and once it puts it inside of the list, I cannot use it as an Exceptions anymore.
Is there a way to hold Exceptions in a dynamic array? Regular arrays with a set max just don't seem to work for some reason.
Also, is there a way to capture ALL Exceptions that happen within a program? Like some sort of an event? Or am I going to have to encapsulate everything in try/catch statements?
Incase you haven't noticed, I'm trying to write a self-contained DLL file in which writes the user's computer information to a log file, then on close, ALL exception information that happens with my program is also written to the log file. Later I'm gonna make a dialogbox out of just code to ask the user if they want to send it directly to me. This would make it alot easier to track errors on computers once it leaves the development environment.
When I add an Exception to the ArrayList, it converts it to an Object and once it puts it inside of the list, I cannot use it as an Exceptions anymore.
Is there a way to hold Exceptions in a dynamic array? Regular arrays with a set max just don't seem to work for some reason.
Also, is there a way to capture ALL Exceptions that happen within a program? Like some sort of an event? Or am I going to have to encapsulate everything in try/catch statements?
Incase you haven't noticed, I'm trying to write a self-contained DLL file in which writes the user's computer information to a log file, then on close, ALL exception information that happens with my program is also written to the log file. Later I'm gonna make a dialogbox out of just code to ask the user if they want to send it directly to me. This would make it alot easier to track errors on computers once it leaves the development environment.