Create code for invisible ActiveX Object event handlers in Delphi

You know that in Visual Studio you can use the "+ =" syntax and a couple of tabs so that it automatically generates code for the event handler?

How do I do the same in Delphi? I am trying to create an event handler for the invisible activex library that I imported using the Import Component function.

I understand that with imported activex controls, you can simply click on an object, view the events tab for what the component provides, and double-click on an event to generate it for you.

These activex components are invisible, so you can select them in the form. Can Delphi automatically generate code? If not, can someone give me some sample code?

+3
source share
1 answer

In Delphi, even non-visual components are presented in the form as small boxes with an icon. Just select this component and you can go to events from the object inspector.

If you did not install it on the component pallet, then there is no code auto-generation for the event handler. The easiest way is to go to the generated tlb.pas file and find the signature of the required event, copy it and create a compatible method for it. Then simply point the event property to this new method.

+5
source

All Articles