Delphi – finding published event handlers that have lost their binding from the DFM
Posted by jpluimers on 2018/05/15
The scripts in these links didn’t work well enough for me:
- [WayBack] Q: Is there a tool to find code that was written as an event-handler, but decoupled in the DFM – Vin Colgin – Google+Bash script at [WayBack] http://pisil.de/events.txt and [WayBack] http://pisil.de/wsl_events_2.txt
- via: [WayBack] Is there a tool that matches published methods on designers to actually have events hooked to them? – Jeroen Wiert Pluimers – Google+
So I’ve been working on a GExperts based solution (because that gave me a nice starting point). It’s not fully done yet, so here are a few things I’ve used:
- [WayBack] Hallvard’s Blog: Hack #10: Getting the parameters of published methods
- The streaming mechanism looks for published methods in the RTTI that have a name equal to the event in the stream and a signature matching the event type.The default section by definition has visibility published for anything compiled in $M+ mode (which is enabled for TPersistent and inherits to descendants).
- The ancient [WayBack] TReader.FindMethodInstance Method that is now at [WayBack] System.Classes.TReader.FindMethodInstance – RAD Studio API Documentation
function FindMethodInstance(Root: TComponent; const MethodName: string): TMethod; virtual;
- a
(Reminder to self: contact David Hoyle who knows a lot about the OTA).
–jeroen
Leave a Reply