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


取得值,指出 Type 是否為 COM 物件。Gets a value indicating whether the Type is a COM object.

 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.