1
Guys I’m trying to refine my bug log and I came up with an idea.
Using a component ApplicationEvents
I have a routine that records the error log, in it I get the error in E.Message
, and the Sender component that generated the error, until then beauty, it happens that sometimes a Objeto
does not have the property Name and yes Classename, in this case it is difficult to identify where the error came from, to improve I capture the Active form with "Screen.ActiveControl.UnitName
", but sometimes the active form is not the one that generated the error but one that is being created by him... in this case I would have to take the Component that generated the error and go up the hierarchy, so I would know which route I should do to simulate the error in the development.
It also has a function attached to this routine that captures the screen at the time of the error, but sometimes the delay that exists does not capture exactly where the mouse was, because it can be in a menu that has already closed.
That is, in short I need to go through the hierarchy of an Object, how can I do this?
Complementing because I need the hierarchy, because sometimes a component is within a Panel->TabSheet->PageControl->Panel->Form
.
Um interesting... can you tell me if this function would work with non-visual components? For example, the error is in a Query Field, so the hierarchy would be: Field->Query->Form, that is, the component is in a form because it is not Twincontrol.
– Marcelo
@Marcelo, I just edited the answer. I lowered a little more in the inheritance, now using the Tcomponent and returning the Parent by the Getparentcomponent method, this way also works for the non-visual components.
– Confundir
Thank you very much, that’s right
– Marcelo