I want to get the stack trace but it is always empty?
try{
int a = 5, b = 0;
int c = a/b;
}
catch(Exception &e){
ShowMessage("Exception: " + e.Message + "\nStackTrace:" + e.StackTrace);
}
Using C++ Builder XE2.
Edit: This code executes on TForm1::Button1Click.
Found the answer here: https://forums.embarcadero.com/thread.jspa?messageID=419807&tstart=0
However, the property returns an empty string by default. It is designed so third-party exception loggers (MadExcept, EurekaLog, etc) can hook into it to provide the actual stack trace information. Why Embarcadero has chosen not to provide their own native implementation is anyone's guess.