Page 1 of 1

Get StackTrace for Exception

Posted: Mon Apr 10, 2017 2:48 pm
by Batteken
Hello,

I would like to do the following:
try
{
...
some code that could generate exceptions
...
}
catch(Exception& e)
{
-> show the stacktrace that matches the exception
}

How could I do this ?

regards,
Bart

Re: Get StackTrace for Exception

Posted: Mon Apr 10, 2017 2:55 pm
by madshi
How do you want to "show" the stack trace? MessageBox? Writing to a log?

Re: Get StackTrace for Exception

Posted: Mon Apr 10, 2017 3:27 pm
by Batteken
Write to own log file.

Re: Get StackTrace for Exception

Posted: Mon Apr 10, 2017 3:28 pm
by Batteken
So, basically, just get it as a string

Re: Get StackTrace for Exception

Posted: Mon Apr 10, 2017 3:50 pm
by madshi
Then please use "GetCrashStackTrace()" exported by madExcept.pas:

http://help.madshi.net/madExceptUnit.ht ... StackTrace

Re: Get StackTrace for Exception

Posted: Mon Apr 10, 2017 7:43 pm
by Batteken
Thx, I will try that tomorrow.

Re: Get StackTrace for Exception

Posted: Tue Apr 11, 2017 9:30 am
by Batteken
Thanks,

It is exactly what I wanted !

regards,
Bart