tags:

views:

72

answers:

3

How do I determine if an object is a COM object? I need to call Marshal.FinalReleaseComObject on all COM objects in an array of type Object.

+7  A: 

Marshal.IsComObject

David Morton
+2  A: 

You can call GetType() and inspect the IsCOMObject property

Nick
+4  A: 
typeof(myObject).IsCOMObject

or

instanceOfMyObject.GetType().IsCOMObject
Yuriy Faktorovich