InterfaceTypeAttributeとは? わかりやすく解説

InterfaceTypeAttribute クラス

COM への公開時に、マネージ インターフェイスデュアルディスパッチ専用、または IUnknown 専用のいずれであるかを示します

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Interface, Inherited:=False)> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class
 InterfaceTypeAttribute
    Inherits Attribute
Dim instance As InterfaceTypeAttribute
[AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false)]
 
[ComVisibleAttribute(true)] 
public sealed class InterfaceTypeAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Interface, Inherited=false)]
 
[ComVisibleAttribute(true)] 
public ref class InterfaceTypeAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false)
 */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class InterfaceTypeAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false)
 
ComVisibleAttribute(true) 
public final class InterfaceTypeAttribute extends
 Attribute
解説解説

この属性は、インターフェイス適用できます

タイプ ライブラリ エクスポータ (Tlbexp.exe) は既定では、マネージ インターフェイスデュアル インターフェイスとして COM公開します。これによって、遅延バインディング柔軟性事前バインディングパフォーマンスを得ることができます。ComInterfaceType 列挙体を使用すると、既定動作オーバーライドして、遅延バインディングだけ、または事前バインディングだけを指定できます。たとえば、InterfaceType (ComInterfaceType.InterfaceIsIDispatch)インターフェイス適用すると、呼び出し元を遅延バインディングだけに制限するメタデータ生成できますIDispatch インターフェイスから継承したインターフェイス多くデュアル インターフェイスですが、InterfaceIsIDispatch 列挙メンバ使用すると、インターフェイスメソッドに対して遅延バインディング呼び出しだけを許可できます。この属性は、インターフェイスマネージ ビューには影響与えません。インターフェイスCOM公開する方法詳細については、「エクスポート時の型の変換」を参照してください

タイプ ライブラリ インポータ (Tlbimp.exe) はまた、インポートされた非デュアル インターフェイスにこの属性適用します。適切な列挙メンバ適用することによって、インターフェイスディスパッチ専用IUnknown 専用かを示します

使用例使用例

InterfaceTypeAttributeインターフェイスCOM公開する方法制御する方法次の例に示します

Imports System.Runtime.InteropServices

'Interface is exposed to COM as dual.
Interface IMyInterface1
     'Insert code here.
End Interface

'Interface is exposed to COM as IDispatch.
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
Interface IMyInterface2
    'Insert code here.
End Interface
using System.Runtime.InteropServices;

//Interface is exposed to COM as dual.
interface IMyInterface1 
{
    //Insert code here.
}

//Interface is exposed to COM as IDispatch.
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
interface IMyInterface2 
{
    //Insert code here.
}
using namespace System::Runtime::InteropServices;

//Interface is exposed to COM as dual.
interface class IMyInterface1{};

//Insert code here.
//Interface is exposed to COM as IDispatch.

[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIDispatch)]
interface class IMyInterface2{};
//Insert code here.
import System.Runtime.InteropServices.*;

//Interface is exposed to COM as dual.
interface IMyInterface1
{
    //Insert code here.
} //IMyInterface1

//Interface is exposed to COM as IDispatch.
/** @attribute InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)
 */
interface IMyInterface2
{
    //Insert code here.
} //IMyInterface2
import System.Runtime.InteropServices

//Interface will be exposed to COM as dual.
interface IMyInterface1{
     // ...
}

//Interface will be exposed to COM as IDispatch.
public InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)
interface IMyInterface2{
    // ...
}
継承階層継承階層
System.Object
   System.Attribute
    System.Runtime.InteropServices.InterfaceTypeAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
InterfaceTypeAttribute メンバ
System.Runtime.InteropServices 名前空間
ComInterfaceType 列挙
その他の技術情報
タイプ ライブラリ エクスポータ (Tlbexp.exe)
タイプ ライブラリ インポータ (Tlbimp.exe)

InterfaceTypeAttribute コンストラクタ (ComInterfaceType)

指定した ComInterfaceType 列挙メンバ使用して、InterfaceTypeAttribute クラス新しインスタンス初期化します。

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    interfaceType As ComInterfaceType _
)
Dim interfaceType As ComInterfaceType

Dim instance As New InterfaceTypeAttribute(interfaceType)
public InterfaceTypeAttribute (
    ComInterfaceType interfaceType
)
public:
InterfaceTypeAttribute (
    ComInterfaceType interfaceType
)
public InterfaceTypeAttribute (
    ComInterfaceType interfaceType
)
public function InterfaceTypeAttribute (
    interfaceType : ComInterfaceType
)

パラメータ

interfaceType

インターフェイスCOM クライアント公開する方法記述する ComInterfaceType 値の 1 つ

解説解説

エラー招きにくく、読みやすいコードにするためには、常にこのコンストラクタ使用してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
InterfaceTypeAttribute クラス
InterfaceTypeAttribute メンバ
System.Runtime.InteropServices 名前空間

InterfaceTypeAttribute コンストラクタ (Int16)

指定した ComInterfaceType 列挙メンバ使用して、InterfaceTypeAttribute クラス新しインスタンス初期化します。

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

このコンストラクタは、ComInterfaceType 列挙体の各メンバを表す、基になる 16 ビット整数値を受け取りますタイプ ライブラリ インポータ (Tlbimp.exe) は、このコンストラクタ使用します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
InterfaceTypeAttribute クラス
InterfaceTypeAttribute メンバ
System.Runtime.InteropServices 名前空間
その他の技術情報
タイプ ライブラリ インポータ (Tlbimp.exe)

InterfaceTypeAttribute コンストラクタ

InterfaceTypeAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
InterfaceTypeAttribute (ComInterfaceType) 指定した ComInterfaceType 列挙メンバ使用してInterfaceTypeAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

InterfaceTypeAttribute (Int16) 指定した ComInterfaceType 列挙メンバ使用してInterfaceTypeAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

InterfaceTypeAttribute クラス
InterfaceTypeAttribute メンバ
System.Runtime.InteropServices 名前空間

InterfaceTypeAttribute プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

InterfaceTypeAttribute クラス
System.Runtime.InteropServices 名前空間
ComInterfaceType 列挙

その他の技術情報

タイプ ライブラリ エクスポータ (Tlbexp.exe)
タイプ ライブラリ インポータ (Tlbimp.exe)

InterfaceTypeAttribute メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
参照参照

関連項目

InterfaceTypeAttribute クラス
System.Runtime.InteropServices 名前空間
ComInterfaceType 列挙

その他の技術情報

タイプ ライブラリ エクスポータ (Tlbexp.exe)
タイプ ライブラリ インポータ (Tlbimp.exe)

InterfaceTypeAttribute メンバ

COM への公開時に、マネージ インターフェイスデュアルディスパッチ専用、または IUnknown 専用のいずれであるかを示します

InterfaceTypeAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド InterfaceTypeAttribute オーバーロードされます。 InterfaceTypeAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
参照参照

関連項目

InterfaceTypeAttribute クラス
System.Runtime.InteropServices 名前空間
ComInterfaceType 列挙

その他の技術情報

タイプ ライブラリ エクスポータ (Tlbexp.exe)
タイプ ライブラリ インポータ (Tlbimp.exe)



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「InterfaceTypeAttribute」の関連用語

InterfaceTypeAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



InterfaceTypeAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS