Type.IsCOMObject Type.IsCOMObject Type.IsCOMObject Type.IsCOMObject Property

定义

获取一个值,通过该值指示 Type 是否为 COM 对象。Gets a value indicating whether the Type is a COM object.

public:
 property bool IsCOMObject { bool get(); };
public bool IsCOMObject { get; }
member this.IsCOMObject : bool
Public ReadOnly Property IsCOMObject As Boolean

属性值

如果 true 为 COM 对象,则为 Type;否则为 falsetrue if the Type is a COM object; otherwise, false.

实现

注解

此方法返回false的 COM 接口,因为它们不是对象。This method returns false for COM interfaces because they are not objects. 可以通过 Microsoft.NET Framework 对象实现 COM 接口。COM interfaces can be implemented by Microsoft .NET Framework objects.

此外可以加载 COM 类,并获得Type通过使用该 COM 类的对象Tlbimp.exe (类型库导入程序)工具。You can also load a COM class and get a Type object for that COM class by using the Tlbimp.exe (Type Library Importer) tool.

如果当前Type表示构造泛型类型,此属性适用于从其构造类型的泛型类型定义。If the current Type represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. 例如,如果当前Type表示MyGenericType<int> (MyGenericType(Of Integer)在 Visual Basic 中),此属性的值由MyGenericType<T>For example, if the current Type represents MyGenericType<int> (MyGenericType(Of Integer) in Visual Basic), the value of this property is determined by MyGenericType<T>.

如果当前Type表示泛型类型或泛型方法定义中的类型参数,此属性始终返回falseIf the current Type represents a type parameter in the definition of a generic type or generic method, this property always returns false.

适用于

另请参阅