View previous topic :: View next topic |
Author |
Message |
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Wed Jan 09, 2008 11:11 am Post subject: Any way to trap exceptions? |
|
|
I am a non technical member of a software company, but provide support on our product.
From time to time users of our software report fatal exception errors when for instance the program has run out of resources such as graphics memory.
I am told by one of our developers that FTN95 is unable to trap such 'unexpected' errors, while most other development products do.
Is this the case or are we missing some functionality in the system?
Help would be appreciated.
Thanks. _________________ Lozzer |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jan 09, 2008 1:41 pm Post subject: |
|
|
Under Win32 (not .NET) you will find exception handling routines in the help file under FTN95 library->Error and exception handling.
The standard routine to use is TRAP_EXCEPTION@.
Having trapped an exception is it usually not possible to recover from this state (whether using FTN95 or not). The best you can do is save your data and exit gracefully. |
|
Back to top |
|
|
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Wed Jan 09, 2008 2:01 pm Post subject: |
|
|
Thank you Paul. I'll check if we're already doing this much. _________________ Lozzer |
|
Back to top |
|
|
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Wed Jan 09, 2008 3:11 pm Post subject: |
|
|
That's worked a treat.
Thanks. _________________ Lozzer |
|
Back to top |
|
|
Steve
Joined: 23 Feb 2007 Posts: 73
|
Posted: Wed Feb 13, 2008 12:33 pm Post subject: Trap exception |
|
|
Thanks for the reference in the FTN95 manual.
Have attempted to use TE and sure enough the callback can get invoked. Unfortunately, a heck of a lot of calls are being made so by call GetLastError() values of zero are ignored.
What has now been happening is that unusual "errors" are causing the TE to be invoked. For example, after an OPEN of a direct accdess file the GetLastError() #183 ( "Cannot create a file when that file already exists" ) happens for no apparent reason.
In order to stop the TE reacting to the error the ALL_EXCEPTIONS setting cannot be used - in fact, only the ACCESS_VIOLATION seems to be the only TE setting to not force the callback.
Any advice / help ? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Feb 13, 2008 1:17 pm Post subject: |
|
|
I would not use ALL_EXCEPTIONS. Some exceptions are benign.
Identify the particular types of exception that you want to trap and provide a handler for each one in turn. |
|
Back to top |
|
|
|