Hi, I am trying to inject a logging mechanism to identify the user created the record from a Users table in the database and set them on the AfterInsert, BeforePost Events for the fields (CreatedBy, CreatedDateTime, ModifiedBy, ModifiedDateTime) if they exists in the dataset instance. The (LoggerUserID, LoggerUserName ) vars are set after the user login but set them here just to test the code.

The project itself is written in C++ but because I know C++ does not support interposer classes so I had to created it in Delphi. When i use this unit in my project nothing happens I even tried to raise an exception instead of the actual code to check if it does anything or not. I am not so good at Delphi.

I don't wanna end up setting the AfterInsert, BeforePost events for about 50 TDataSet instances. Knowing that Some Datasets have their own OnAfterInsert, OnBeforePost events assigned.

If what you are trying to do is mod an existing component to override some functions, i think you need make your code into a package itself and add the .bpi of the main component you want to integrate with to the "Requires" section of your modded component.