C# plugin to fire an Event in Delphi Host

Hello

This is the sample you need: Need simple sample - #2 by antonk

The code there is old and might not even build in the latest Hydra versions, still you should see the approach where host sets the callback site and plugin raises its events:

unit uCustomInterfaces;

interface

uses
  uHYCrossPlatformInterfaces;

type

  ImyInterfaceEvents = interface;

  IInterfaceThatHasEvents = interface(IHYCrossPlatformInterface)
  ['{BE177C76-B8B0-47CE-B268-1BE1A3006866}']
    procedure SetEventSink(Sink: ImyInterfaceEvents); safecall;
  end;

  ImyInterfaceEvents = interface(IHYCrossPlatformInterface)
  ['{2227E41C-DC30-4B1E-8482-80430C0199BF}']
    procedure ButtonClick(Sender: IInterfaceThatHasEvents); safecall;
  end;


implementation

end.

Regards