I found the solution if I asked for "C# events in VB6". The main thing is the interface of type dispatch and how to bind it to the class with the code. Here is the code how I solved this:
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace SceSapGui
{
public delegate void SceEventHandler(object text, EventArgs e);
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
[GuidAttribute("00000000-0000-0000-0000-000000000001")]
[ComVisible(true)]
public interface ISceSapGuiDispatch
{
[DispId(1)]
void SceClicked(object text, EventArgs e);
}
[GuidAttribute("00000000-0000-0000-0000-000000000002")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface ISceSapGui
{
void Init(string @URI);
string R3ReturnCode { get; }
}
[GuidAttribute("00000000-0000-0000-0000-000000000003")]
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(ISceSapGuiDispatch))]
[ComVisible(true)]
public partial class SceSapGui : ISceSapGui
{
#region Interface member ISceSapGuiDispatch
public event SceEventHandler SceClicked;
protected virtual void OnSceClicked(EventArgs e, string text)
{
if (this.SceClicked != null)
this.SceClicked((object)text, new EventArgs());
}
#endregion
#region Interface member ISceSapGui
[ComVisible(true)]
public void Init(string @URI)
{
}
[ComVisible(true)]
public string R3ReturnCode
{
get { return "0"; }
}
#endregion
}
}