ComDefaultInterfaceAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<AttributeUsageAttribute(AttributeTargets.Class, Inherited:=False)> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class ComDefaultInterfaceAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Class, Inherited=false)] [ComVisibleAttribute(true)] public sealed class ComDefaultInterfaceAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class, Inherited=false)] [ComVisibleAttribute(true)] public ref class ComDefaultInterfaceAttribute sealed : public Attribute

コンパイラは、インターフェイスの実装順序に従うとは限りません。たとえば、次のようなコードがあるとします。
コンパイラは、実装されているインターフェイスを IDervied, IBase として出力します。明示的なインターフェイスを既定のインターフェイスとして公開するために [ClassInterface(ClassInterfaceType.None)] で ClassInterfaceAttribute クラスを使用する場合は、インターフェイスの順序が重要です。指定した ClassInterfaceType に関係なく、ComDefaultInterfaceAttribute 属性を使用して、どのインターフェイスを既定として認識するかを指定します。
ComDefaultInterfaceAttribute で装飾された型は、実際に、既定のインターフェイスとして指定したインターフェイスから派生する必要があります。

System.Attribute
System.Runtime.InteropServices.ComDefaultInterfaceAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ComDefaultInterfaceAttribute クラスのページへのリンク