I have searched Google many times for this problem, can't find a solution.
I am using a legacy COM Libraby written in VB6. The three objects that I use are:
DBConnect, Document, Application. At the end of my program I write DBConnect.Logout(), however it won't let me do that if Document or Application objects are still present.
In VB6 I just wrote Document = Nothing; Application = Nothing. In .NET this does not have the same effect. I read on MSDN that in .NET the object does not get destroyed when you set it to nothing, but it gets destroyed when the garbadge collector goes through it. Since this library is an SDK kit, i can't see the code, nor can I edit/add anything to it. Might you have any idea on how to force-destroy an object in VB.NET ?
Steve
I am using a legacy COM Libraby written in VB6. The three objects that I use are:
DBConnect, Document, Application. At the end of my program I write DBConnect.Logout(), however it won't let me do that if Document or Application objects are still present.
In VB6 I just wrote Document = Nothing; Application = Nothing. In .NET this does not have the same effect. I read on MSDN that in .NET the object does not get destroyed when you set it to nothing, but it gets destroyed when the garbadge collector goes through it. Since this library is an SDK kit, i can't see the code, nor can I edit/add anything to it. Might you have any idea on how to force-destroy an object in VB.NET ?
Steve