L
Li
Hello,
I have a C# class library with a form inside (ComVisible(true)) that is
instantiated by a VB6 executable. So far, so good.
I created an event at C# that has to be handled by VB6. This event works
fine when I use a VB.Net executable, but at VB6 it doesn't even recognize
that the C# form has an event.
I will be very grateful if someone could help me, showing my mistakes.
Thanks in advance.
Below is the concise code that works at VB.Net but (a similar code, written
in VB) do not at VB6:
[ComVisible(true)]
public partial class frmMain: Form
{
public event EventHandler OnDoSomething;
public void DoSomething()
{
if (this.OnDoSomething() != null)
this.OnDoSomething(this, new EventHandler());
}
}
---------------------------------------------------
Dim WithEvents frmTest As <library reference>
Public Sub TestOnDoSomething(ByVal sender as Object, ByVal e as EventArgs)
Handles frmTest.OnDoSomething
...
End Sub
I have a C# class library with a form inside (ComVisible(true)) that is
instantiated by a VB6 executable. So far, so good.
I created an event at C# that has to be handled by VB6. This event works
fine when I use a VB.Net executable, but at VB6 it doesn't even recognize
that the C# form has an event.
I will be very grateful if someone could help me, showing my mistakes.
Thanks in advance.
Below is the concise code that works at VB.Net but (a similar code, written
in VB) do not at VB6:
[ComVisible(true)]
public partial class frmMain: Form
{
public event EventHandler OnDoSomething;
public void DoSomething()
{
if (this.OnDoSomething() != null)
this.OnDoSomething(this, new EventHandler());
}
}
---------------------------------------------------
Dim WithEvents frmTest As <library reference>
Public Sub TestOnDoSomething(ByVal sender as Object, ByVal e as EventArgs)
Handles frmTest.OnDoSomething
...
End Sub