How can I ignore an exception?
How can I ignore an exception?
For leaks there is a function HideLeak.
Does something similar exist for exceptions?
I would like to ignore TCustomForm.CloseQuery.
Is this possible?
Does something similar exist for exceptions?
I would like to ignore TCustomForm.CloseQuery.
Is this possible?
Re: How can I ignore an exception?
Hello,
You can added classes to a filter rule, something as simple as specified here
http://help.madshi.net/madExceptSettings3.htm
--Iconic
You can added classes to a filter rule, something as simple as specified here
http://help.madshi.net/madExceptSettings3.htm
--Iconic
Re: How can I ignore an exception?
Hmmmm... "TCustomForm.CloseQuery" is not an exception. Can you clarify what you mean exactly?
Re: How can I ignore an exception?
We get many exception messages from customers which were caused within of OnFormCloseQuery.
If there are projects which were changed but not saved then we pop up a message to ask what to do.
Now we have customers who have open projects and want to shut down windows.
Or we open a dialog box after starting the program but the user only started the software and then shuts the system down.
The explorer shows them that we expect a customer reaction - but they ignore it and continue to shut down.
It looks then somehow like
I would like to be able to switch on/off madexcept when FormCloseQuery is called.
Is that possible?
If there are projects which were changed but not saved then we pop up a message to ask what to do.
Now we have customers who have open projects and want to shut down windows.
Or we open a dialog box after starting the program but the user only started the software and then shuts the system down.
The explorer shows them that we expect a customer reaction - but they ignore it and continue to shut down.
It looks then somehow like
Code: Select all
exception message : Zugriffsverletzung bei Adresse 0000000000000000 in Modul 'MyProgram.exe'. Ausführung von Adresse 0000000000000000.
main thread ($2a70):
00000000 +0000 ???
0167b34b +02cb MyProgram.exe MyMainFRM 8824 +97 TMyMainForm.FormCloseQuery
00b55e3a +007a MyProgram.exe Vcl.Forms TCustomForm.CloseQuery
00b54322 +0012 MyProgram.exe Vcl.Forms TCustomForm.WMQueryEndSession
Is that possible?
Re: How can I ignore an exception?
Can you reproduce this problem on your development PC? If so, that would be helpful testing how to solve it in the best way.
There are various options:
1) You could call "PauseMadExcept()" at the start of FormCloseQuery(). However, if you do that and an exception occurs, you'll get the standard Delphi exception box.
2) Or you could add a try..except block around your code in FormCloseQuery().
3) Or you could try to actually find the cause of the crash. It looks like line 8824 of your MyMainFRM.pas jumps to a "nil" pointer, for some reason.
Probably there are even more things you could do, but maybe one of those above already helps?
There are various options:
1) You could call "PauseMadExcept()" at the start of FormCloseQuery(). However, if you do that and an exception occurs, you'll get the standard Delphi exception box.
2) Or you could add a try..except block around your code in FormCloseQuery().
3) Or you could try to actually find the cause of the crash. It looks like line 8824 of your MyMainFRM.pas jumps to a "nil" pointer, for some reason.
Probably there are even more things you could do, but maybe one of those above already helps?
Re: How can I ignore an exception?
The user does not close the software the proper way. Therefore I do not want to invest much time.
So I guess that the least problematic way is to use version 2.
I was so focussed on switching off madexcept that I did not see the most obvious solution.
So I guess that the least problematic way is to use version 2.
I was so focussed on switching off madexcept that I did not see the most obvious solution.
Re: How can I ignore an exception?
Hehe! Yes, if 2) works for you then yes, it's probably the easiest and "best" solution.