Custom attribute to specify that a class has a COM default interface.
This custom attribute indicates that the class has an explicit default interface. If the custom attribute is present, the first Interface implementation supplied when the type was defined is assumed to be the default interface for the class. If a custom value is missing, the default interface is assumed to be the class interface for the class. See the Interop Spec for important details.
Object
Attribute
HasDefaultInterfaceAttribute
[Visual Basic] Public Class HasDefaultInterfaceAttribute Inherits Attribute [C#] public class HasDefaultInterfaceAttribute : Attribute [C++] public __gc class HasDefaultInterfaceAttribute : public Attribute [JScript] public class HasDefaultInterfaceAttribute extends Attribute
Can be used to attribute classes.
COM to NGWS runtime interpretation: The absence of this attribute control causes TlbExp to generate the definition of the class interface in the exported type library. The class interface is also identified as the default interface for the coclass. If the attribute is present, the first interface in the list of interfaceImpls (usually the first interface listed in the inheritance list) is assumed to be the default interface and is identified as such when the type library is exported.
NGWS runtime to COM interpretation: This attribute is set on all classes that are imported from a COM typelib that have an explicitly identified default interface. The default interface is always the first interface in the list of interfaceImpls.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll
HasDefaultInterfaceAttribute Members | System.Runtime.InteropServices Namespace