Marshal.IsComObject-Methode: (Object)
Gibt an, ob ein angegebenes Objekt ein COM-Objekt darstellt.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Syntax
public static bool IsComObject(
object o
)
public:
static bool IsComObject(
Object^ o
)
static member IsComObject :
o:Object -> bool
Public Shared Function IsComObject (
o As Object
) As Boolean
Parameter
o
Type: System.ObjectDas zu überprüfende Objekt.
Rückgabewert
Type: System.Boolean
true, wenn der o-Parameter ein COM-Typ ist, andernfalls false.
Ausnahmen
Exception | Condition |
---|---|
ArgumentNullException | o ist null. |
Hinweise
IsComObject returns true if the class type of the instance is attributed with System.Runtime.InteropServices.ComImportAttribute or if it derives directly or indirectly from a class attributed with ComImportAttribute. The Tlbimp.exe (Type Library Importer) tool applies this attribute for you when it imports a type library.
Two other methods also determine whether a specified object represents a COM object, but the requirements for returning true differ from this method's requirements. P:System.Type.IsImport returns true if the class (or interface) is attributed with T:System.Runtime.InteropServices.ComImportAttribute directly; it does not return true for derived types. M:System.Runtime.InteropServices.RegistrationServices.TypeRepresentsComType(System.Type) returns true if the type is attributed with T:System.Runtime.InteropServices.ComImportAttribute or derives from a type with the same GUID.
Versionsinformationen
Universelle Windows-Plattform
Verfügbar seit 8
.NET Framework
Verfügbar seit 1.1
Portierbare Klassenbibliothek
Unterstützt in: portierbare .NET-Plattformen
Windows Phone Silverlight
Verfügbar seit 8.0
Windows Phone
Verfügbar seit 8.1
Siehe auch
ComImportAttribute
IsImport
TypeRepresentsComType
Marshal-Klasse
System.Runtime.InteropServices-Namespace
Zurück zum Anfang