 | C++ |
 | pPKHist = NULL |
 | The object is destroyed immediately. |
 | C# |
 | System.Runtime.InteropServices.Marshal.ReleaseComObject(oPKHist) |
 | oPKHist = null |
 | By assigning the object to null the object is released (the reference count is decremented) but not destroyed. The garbage collector decides when the object is actually destroyed. Adding the ReleaseComObject-statement speeds up the actual destruction of the object. |
 | VBS |
 | Set oPKHist = Nothing |
 | The object is destroyed immediately. |
 | VBN |
 | System.Runtime.InteropServices.Marshal.ReleaseComObject(oPKHist) |
 | oPKHist = Nothing |
 | By assigning the object to Nothing the object is released (the reference count is decremented) but not destroyed. The garbage collector decides when the object is actually destroyed. Adding the ReleaseComObject-statement speeds up the actual destruction of the object. |