Do I need to do anything special with COM objects in .NET list?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Victor Hadianto

    Do I need to do anything special with COM objects in .NET list?

    Just checking, can't Google any definitive answer, say I'm doing
    something like this:

    IList<IUnknown> comObjList = new IList<IUnknown> ();
    IUnknown comObject = Activator.Creat eInstance(...); // COM object eg:
    VB dll, c/c++ etc.
    comObjList.Add( comObject);

    When comObjList goes out of scope, the COM object should be garbage
    collected. Is this right? I don't have to do some funky add/remove
    reference count from the COM object right?

    Ta,
    Vic


Working...