Pavel Tupec
23-Nov-2007, 07:49 AM
Hi Fabio,
I have a problem with function GetLastExceptionCallStack in C++Builder.
Functions returns NULL. But function ShowLastExceptionData works fine.
I use latest EurekaLog 6.0.10.
This Delphi code works fine:
var
CallStackList: TStringList;
CallStack: TEurekaStackList;
result : string;
begin
try
raise Exception.Create('Original exception!'); // <-- Will be displayed
this line as exception line!
except
CallStackList := TStringList.Create;
try
CallStack := GetLastExceptionCallStack;
try
CallStackToStrings(CallStack, CallStackList);
result := CallStackList.Text;
finally
CallStack.Free;
end;
finally;
CallStackList.Free;
end;
end;
end;
but the same code on CBuilder doesn't work:
try
{
throw Sysutils::Exception("My violation");
}
catch(Sysutils::Exception &e)
{
Classes::TStringList * pExStackList = new Classes::TStringList;
Exceptionlog::TEurekaStackList * pEurekaCS =
GetLastExceptionCallStack();
if (pEurekaCS) {
CallStackToStrings(pEurekaCS, pExStackList);
// do something...
delete pEurekaCS;
}
if (pExStackList) delete pExStackList;
}
What I do wrong?
Pavel Tupec
I have a problem with function GetLastExceptionCallStack in C++Builder.
Functions returns NULL. But function ShowLastExceptionData works fine.
I use latest EurekaLog 6.0.10.
This Delphi code works fine:
var
CallStackList: TStringList;
CallStack: TEurekaStackList;
result : string;
begin
try
raise Exception.Create('Original exception!'); // <-- Will be displayed
this line as exception line!
except
CallStackList := TStringList.Create;
try
CallStack := GetLastExceptionCallStack;
try
CallStackToStrings(CallStack, CallStackList);
result := CallStackList.Text;
finally
CallStack.Free;
end;
finally;
CallStackList.Free;
end;
end;
end;
but the same code on CBuilder doesn't work:
try
{
throw Sysutils::Exception("My violation");
}
catch(Sysutils::Exception &e)
{
Classes::TStringList * pExStackList = new Classes::TStringList;
Exceptionlog::TEurekaStackList * pEurekaCS =
GetLastExceptionCallStack();
if (pEurekaCS) {
CallStackToStrings(pEurekaCS, pExStackList);
// do something...
delete pEurekaCS;
}
if (pExStackList) delete pExStackList;
}
What I do wrong?
Pavel Tupec