ClassInterfaceType 列挙体
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Enumeration ClassInterfaceType



ClassInterfaceAttribute を型に適用し、ClassInterfaceType を設定する例を次に示します。この方法で定義されたクラスは、アンマネージ COM から使用できます。
using System; using System.Runtime.InteropServices; // Have the CLR expose a class interface (derived from IDispatch) for this type. // COM clients can call the members of this class using the Invoke method from the IDispatch interface. [ClassInterface(ClassInterfaceType.AutoDispatch)] public class AClassUsableViaCOM { public AClassUsableViaCOM() { } public Int32 Add(Int32 x, Int32 y) { return x + y; } } // The CLR does not expose a class interface for this type. // COM clients can call the members of this class using the methods from the IComparable interface. [ClassInterface(ClassInterfaceType.None)] public class AnotherClassUsableViaCOM : IComparable { public AnotherClassUsableViaCOM() { } Int32 IComparable.CompareTo(Object o) { return 0; } }
using namespace System; using namespace System::Runtime::InteropServices; // Have the CLR expose a class interface (derived from IDispatch) // for this type. COM clients can call the members of this // class using the Invoke method from the IDispatch interface. [ClassInterface(ClassInterfaceType::AutoDispatch)] public ref class AClassUsableViaCOM { public: AClassUsableViaCOM() { } public: int Add(int x, int y) { return x + y; } }; // The CLR does not expose a class interface for this type. // COM clients can call the members of this class using // the methods from the IComparable interface. [ClassInterface(ClassInterfaceType::None)] public ref class AnotherClassUsableViaCOM : public IComparable { public: AnotherClassUsableViaCOM() { } virtual int CompareTo(Object^ o) = IComparable::CompareTo { return 0; } };

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


Weblioに収録されているすべての辞書からClassInterfaceType 列挙体を検索する場合は、下記のリンクをクリックしてください。

- ClassInterfaceType 列挙体のページへのリンク