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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > 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)



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

辞書ショートカット

すべての辞書の索引

「InterfaceTypeAttribute クラス」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS