Define events in COM built in .NET
I built in .NET a 'class library' project , which then I
compiled with "Register for COM interop".
I also added some events.
I use this component in VB6, but I can't hook up to the
Can someone please help?
In the .NET component's code, I tried to define events in
2 different ways:
public delegate void ClickedEventHandler(string val);
public event ClickedEventHandler Clicked;
public interface IMonitorEvent
void HandleMonitorEvent(bool IsEmergency);
Then, in order to hook up to those events in VB6:
1. I added a refernce in VB6 to the component.
2. I created instance
Dim MyObj As ContainerForIE.Form1
Set MyObj = CreateObject("ContainerForIE.Form1")
3. I tried to use
"Public WithEvents MyObj As ContainerForIE.Form1"
But it raises an error "Object does not source
Can anyone help please?