I have a simple C# library that I have registered for COM interop. I have added a reference for this to my vb6 app. I ran my vb application and everything works fine. What I would like to know is how does this work. I checked the task mamager and I see VB6.exe in the processes but I cannot see anything relating to .net.
code: vb6
Dim a As CsharpdllForVBHack.ComAdder
Private Sub Command1_Click()
Set a = New CsharpdllForVBHack.ComAdder
a.Add 1, 4
End Sub
code: C#.net
[ComVisible(true)]
public class ComAdder
{
[ComVisible(true)]
public void add (int a,int b)
{
TestForm testForm = new TestForm(a+b);
testForm.ShowDialog();
}
}
I would also like to know how would I handle disposing of this com object once I am done
We noticed that each time we click on the button and close the form the memory used goes up by a few 100 kb even adding set a= Nothing