I implemented an activeX control with Delphi. Now I want to add an events for it. I use the type library editor to add the event like this.
procedure OnActionMethod(ActionType: Integer; x1: Integer;
y1: Integer; x2: Integer; y2: Integer; param1: Double); dispid 213;
TezDICOMXOnActionMethod = procedure(ASender: TObject;
ActionType: Integer; x1: Integer; y1: Integer; x2: Integer; y2: Integer;
param1: Double) of object;
Everything compile fine.
Now I build a C# application, use that ActiveX control and try to implement an event handler.
private AxezDICOMax.AxezDICOMX the_ezdicom; // this is the activeX object
public void onActionHandler(object sender,long actiontype,
long x1, long y1, long x2,long y2, double param1)
{
MessageBox.Show("abcabc" + x1.ToString() + x2.ToString());
}
private void MainForm_Load(object sender, System.EventArgs e)
{
the_ezdicom.OnActionMethod += new
AxezDICOMax.IezDICOMXEvents_OnActionMethodEventHandler(this.onActionHandler);
}
But the compiler complains with this error
Error 1 No overload for 'onActionHandler' matches delegate
'AxezDICOMax.IezDICOMXEvents_OnActionMethodEventHandler'
OnActionMethodEventHandler
What did I do wrong? I didn't find the OnActionMethodEventHandler() anywhere on my Delphi source.