Type.IsCOMObject プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)


COM インターフェイスはオブジェクトではないため、このメソッドは COM インターフェイスに対しては false を返します。COM インターフェイスは、Microsoft .NET Framework オブジェクトで実装できます。
また、COM クラスを読み込み、その COM クラスの Type オブジェクトを取得するには、タイプ ライブラリ インポータ (Tlbimp.exe) ツールも使用できます。
現在の Type が構築ジェネリック型を表している場合、このプロパティは型が構築される元になったジェネリック型定義に適用されます。たとえば、現在の Type が MyGenericType<int> (Visual Basic では MyGenericType(Of Integer)) を表す場合、このプロパティの値は MyGenericType<T> によって決まります。
現在の Type がジェネリック型またはジェネリック メソッドの定義の型パラメータを表している場合、このプロパティは常に false を返します。

IsCOMObject プロパティを使用する例を次に示します。
<ComVisible(False)> _ Public Class MarshalWrapper <SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.UnmanagedCode)> _ Public Sub MarshalMethod() Dim obj As [Object] obj = Marshal.GetActiveObject("Excel.Application") If Marshal.IsComObject(obj) Then Marshal.ReleaseComObject(obj) End If End Sub 'MarshalMethod End Class 'MarshalWrapper
public class MarshalWrapper { [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)] public void MarshalMethod() { Object obj; obj = Marshal.GetActiveObject("Excel.Application"); if (Marshal.IsComObject(obj)) { Marshal.ReleaseComObject(obj); } } }
public ref class MarshalWrapper { public: [SecurityPermissionAttribute(SecurityAction::Demand, Flags=SecurityPermissionFlag::UnmanagedCode)] void MarshalMethod() { Object^ obj; obj = Marshal::GetActiveObject( "Excel.Application" ); if ( Marshal::IsComObject( obj ) ) { Marshal::ReleaseComObject( obj ); } } };

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.IsCOMObject プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.IsCOMObjectのページへのリンク