Hi,
I have a C++ COM class that I instantiate from VB.NET, but the object never
gets released. Is there something that I need to do to force the
destruction of the object?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim Importer As MyLibrary.Import = New MyLibrary.Import
...
Importer = Nothing
End Sub
The COM class (MyLibrary.Import) is instantiated and everything works fine,
but when the VB.NET function exits, the object is never destroyed (neither
FinalRelease() or the destructor ever get called).
Is there something that I am missing?
Thanks,
- Greg
Brian Muth - 27 Jul 2004 20:11 GMT
> The COM class (MyLibrary.Import) is instantiated and everything works fine,
> but when the VB.NET function exits, the object is never destroyed (neither
> FinalRelease() or the destructor ever get called).
>
> Is there something that I am missing?
Marshal.ReleaseComObject()
Brian
Greg Doherty - 27 Jul 2004 20:32 GMT
Brilliant!
Thanks,
- Greg
> > The COM class (MyLibrary.Import) is instantiated and everything works
> fine,
[quoted text clipped - 6 lines]
>
> Brian