S
Shawn B.
Greets,
If I say
Dim X As Object
X = CreateObject("Some.ProgID")
....
X = Nothing
I assume I'm missing the following
....
System.RunTime.InteropServices.Marshal.ReleaseComObject(X)
X = Nothing
Is supposed to be the correct way of doing this?
If I do it both ways, if I try to move the DLL in question it can't because
it is in use, even after I called ReleaseComObject(x) but when I exit the
application I can.
If I say
....
System.Runtime.InteropServices.Marshal.ReleaseComObject(X)
X = Nothing
GC.Collected()
GC.WaitForPendingFinalizers()
The same. Until I exit the application I can't move the DLL.
My question is this: does this indicate that there is still a reference or
does this indicate that it really hasn't been garbage collected?
If I say
Dim X As Object
Dim X2 As Object
Dim Y As Integer
X = CreateObject("X.Y")
Y = CreateObject("X.Y")
....
Y = System.Runtime.InteropServices.Marshal.ReleaseComObject(X)
....
End Sub
Y will say 0 even though I never Released X2 (only X)...
What is really going on here?
Thanks,
Shawn
If I say
Dim X As Object
X = CreateObject("Some.ProgID")
....
X = Nothing
I assume I'm missing the following
....
System.RunTime.InteropServices.Marshal.ReleaseComObject(X)
X = Nothing
Is supposed to be the correct way of doing this?
If I do it both ways, if I try to move the DLL in question it can't because
it is in use, even after I called ReleaseComObject(x) but when I exit the
application I can.
If I say
....
System.Runtime.InteropServices.Marshal.ReleaseComObject(X)
X = Nothing
GC.Collected()
GC.WaitForPendingFinalizers()
The same. Until I exit the application I can't move the DLL.
My question is this: does this indicate that there is still a reference or
does this indicate that it really hasn't been garbage collected?
If I say
Dim X As Object
Dim X2 As Object
Dim Y As Integer
X = CreateObject("X.Y")
Y = CreateObject("X.Y")
....
Y = System.Runtime.InteropServices.Marshal.ReleaseComObject(X)
....
End Sub
Y will say 0 even though I never Released X2 (only X)...
What is really going on here?
Thanks,
Shawn