08-11-2014 10:23 AM
I've inherited some code with less-than-perfect exception handling. Once in a while I get an unhandled exception. The debugger breaks at Application.Run(), which isn't very helpful. Putting a try()/catch() around Application.Run() lets me display the stack trace, but this isn't helpful either -- all I learn from it is that some NI control somewhere threw an exception.
Is there a way I can find the name of the control which threw the exception?
A simple test case is:
* project with one form, containing two NumericEdit controls
* each control is set to a range of 0 to 100, with "OutOfRangeMode" set to "ThrowException" (the default)
Run the program. Enter a value of -1 in one of the controls Without any exception handler provided, the excption appears at the Application.Run() level. How can I tell which control thew the exception? My actual application has dozens of controls and sometimes crashes at startup. If I knew which control were out of range it'd probably be easy to fix.
Thanks for ideas,
Kevin
08-11-2014 12:18 PM
You are not setting to default values at startup?