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

<ComVisibleAttribute(True)> _ <AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class, Inherited:=False)> _ <ObsoleteAttribute("This attribute is deprecated and will be removed in a future version.", False)> _ Public NotInheritable Class IDispatchImplAttribute Inherits Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class, Inherited=false)] [ObsoleteAttribute("This attribute is deprecated and will be removed in a future version.", false)] public sealed class IDispatchImplAttribute : Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets::Assembly|AttributeTargets::Class, Inherited=false)] [ObsoleteAttribute(L"This attribute is deprecated and will be removed in a future version.", false)] public ref class IDispatchImplAttribute sealed : public Attribute
/** @attribute ComVisibleAttribute(true) */ /** @attribute AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class, Inherited=false) */ /** @attribute ObsoleteAttribute("This attribute is deprecated and will be removed in a future version.", false) */ public final class IDispatchImplAttribute extends Attribute

この属性は、明示的な実装が必要な場合にだけ設定してくださいこの属性を CompatibleImpl に設定する場合、IDispatch 実装は、オブジェクトの型情報を COM の CreateStdDispatch API に渡すことによって提供されます。この属性を InternalImpl に設定する場合、IDispatch 実装は共通言語ランタイムによって提供されます。この属性を SystemDefinedImpl に設定すると、ランタイムは適切な実装を使用できます。アセンブリでこの属性を使用する場合、この属性はそのアセンブリで定義されたすべてのクラスに適用されます。それぞれのクラスで属性を使用する場合、その属性は、そのクラスによって公開されるインターフェイスだけに適用され、アセンブリ レベルの設定をオーバーライドします。

IDispatchImplAttribute を適用し、共通言語ランタイムによって提供された IDispatch 実装を選択する例を次に示します。
Imports System Imports System.Runtime.InteropServices ' by default all classes in this assembly will use COM implementaion <Assembly: IDispatchImpl(IDispatchImplType.CompatibleImpl)> Module MyNamespace ' But this class will use runtime implementaion <IDispatchImpl(IDispatchImplType.InternalImpl)> _ Public Class c ' End Class End Module
using System; using System.Runtime.InteropServices; // by default all classes in this assembly will use COM implementaion [assembly:IDispatchImpl(IDispatchImplType.CompatibleImpl)] namespace MyNamespace { // But this class will use runtime implementaion [IDispatchImpl(IDispatchImplType.InternalImpl)] class MyClass { // } }
using namespace System; using namespace System::Runtime::InteropServices; // by default all classes in this assembly will use COM implementaion // // But this class will use runtime implementaion [assembly:IDispatchImpl(IDispatchImplType::CompatibleImpl)]; [IDispatchImpl(IDispatchImplType::InternalImpl)] ref class MyClass{};
import System.*; import System.Runtime.InteropServices.*; // by default all classes in this assembly will use COM implementaion /** @assembly IDispatchImpl(IDispatchImplType.CompatibleImpl) */ // But this class will use runtime implementaion /** @attribute IDispatchImpl(IDispatchImplType.InternalImpl) */ class MyClass { // } //MyClass

System.Attribute
System.Runtime.InteropServices.IDispatchImplAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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