November 2019
Beginner to intermediate
674 pages
15h
English
The LoggingProxy program from the Proxy folder shows how we can catch and log calls to VCL methods, such as TButton.Click. It uses an interesting trick that allows our code to insert a proxy class without changing the original code. The only downfall of this method is that it can only replace virtual methods, and in the VCL many interesting methods are not marked as such.
The main unit, LoggingProxyMain, implements a simple form containing one button and one listbox. When the button is clicked, a message is displayed. The whole form is implemented as follows:
type TfrmProxy = class(TForm) btnLoggingProxy: TButton; lbLog: TListBox; procedure btnLoggingProxyClick(Sender: TObject); public procedure ...
Read now
Unlock full access