开发者

.NET: How do I determine if an object is a COM object?

开发者 https://www.devze.com 2022-12-21 04:32 出处:网络
How do I de开发者_Python百科termine if an object is a COM object? I need to call Marshal.FinalReleaseComObject on all COM objects in an array of type Object.Marshal.IsComObjecttypeof(myObject).IsCOMOb

How do I de开发者_Python百科termine if an object is a COM object? I need to call Marshal.FinalReleaseComObject on all COM objects in an array of type Object.


Marshal.IsComObject


typeof(myObject).IsCOMObject

or

instanceOfMyObject.GetType().IsCOMObject


You can call GetType() and inspect the IsCOMObject property

0

精彩评论

暂无评论...
验证码 换一张
取 消