Personal I'm trying to refine my error log and an idea came up for me.
Using a ApplicationEvents
component
I have a routine that writes the error log, in it I get the error in E.Message
, and the Sender component that generated the error, so it happens, sometimes a Objeto
does not have the Name property and yes ClassName, in this case it is difficult to identify where the error occurred, to improve it I capture the Form that is Active with " Screen.ActiveControl.UnitName
", but sometimes the active form is not the one that generated the error but rather one that is being created by it ... in that case I would have to get the Component that generated the error and go up the hierarchy, so I would know what course I should do to simulate the development error.
It also has a function coupled 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, since 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 inside a Panel->TabSheet->PageControl->Panel->Form
.