Export (0) Print
Expand All

ComImportAttribute Class

Indicates that the attributed type was previously defined in COM.

For a list of all members of this type, see ComImportAttribute Members.

System.Object
   System.Attribute
      System.Runtime.InteropServices.ComImportAttribute

[Visual Basic]
<AttributeUsage(AttributeTargets.Class Or _
   AttributeTargets.Interface)>
NotInheritable Public Class ComImportAttribute
   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Class |
   AttributeTargets.Interface)]
public sealed class ComImportAttribute : Attribute
[C++]
[AttributeUsage(AttributeTargets::Class |
   AttributeTargets::Interface)]
public __gc __sealed class ComImportAttribute : public Attribute
[JScript]
public
   AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)
class ComImportAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

You can apply this attribute to classes or interfaces, although the Type Library Importer (Tlbimp.exe) typically applies it for you when it imports a type library.

ComImportAttribute is a pseudo-custom attribute that indicates that a type has been defined in a previously published type library. The common language runtime treats these types differently when activating, exporting, coercing, and so on.

A pseudo-custom attribute indicates that bits of the core metadata of a type need to be set when the attribute is present. Unlike a custom attribute that extends the metadata for a type and is saved along with the type, a pseudo-custom attribute modifies the metadata for the type and is discarded.

Requirements

Namespace: System.Runtime.InteropServices

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

ComImportAttribute Members | System.Runtime.InteropServices Namespace | Type Library Importer (Tlbimp.exe)

Show:
© 2014 Microsoft