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

ComRegisterFunctionAttribute クラス

アセンブリCOM から使用できるように登録するときに呼び出すメソッド指定します。これにより、登録処理中にユーザー記述コード実行できるようになります

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

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

この属性は、メソッド適用できます

ComRegisterFunctionAttribute使用すると、COM クライアント要件対応するための任意の登録コード追加できます。たとえば、Microsoft.Win32 名前空間の登録関数使用してレジストリ更新できます。登録メソッド提供する場合は、その登録メソッド実行され操作元に戻すための登録解除メソッドにも System.Runtime.InteropServices.ComUnregisterFunctionAttribute を適用する必要があります

格納しているアセンブリアセンブリ登録ツール (Regasm.exe) や RegistrationServices.RegisterAssembly API メソッド使用して (直接的または間接的に) 登録される場合共通言語ランタイムはこの属性を持つメソッド呼び出します。この属性を持つメソッド参照可能範囲 (パブリックプライベートなど) は任意ですが、このメソッドstatic である必要があり、登録する型を表す Type パラメータ1 つ受け取る必要があります

使用例使用例

適切なシグネチャを持つメソッドComRegisterFunctionAttributeComUnregisterFunctionAttribute適用する方法次の例に示します

Imports System
Imports System.Runtime.InteropServices

Public Class MyClassThatNeedsToRegister
    
    <ComRegisterFunctionAttribute()> Public Shared
 Sub _
      RegisterFunction(t As Type)
        'Insert code here.
    End Sub
    
    <ComUnregisterFunctionAttribute()> Public Shared
 Sub _
      UnregisterFunction(t As Type)
        'Insert code here.
    End Sub
End Class
using System;
using System.Runtime.InteropServices;

public class MyClassThatNeedsToRegister
{
   [ComRegisterFunctionAttribute]
   public static void RegisterFunction(Type
 t)
   {
      //Insert code here.
   }
   
   [ComUnregisterFunctionAttribute]
   public static void UnregisterFunction(Type
 t)
   {
      //Insert code here.
   }
}
using namespace System;
using namespace System::Runtime::InteropServices;
public ref class MyClassThatNeedsToRegister
{
public:

   [ComRegisterFunctionAttribute]
   static void RegisterFunction( Type^ t )
   {
      
      //Insert code here.
   }


   [ComUnregisterFunctionAttribute]
   static void UnregisterFunction( Type^ t
 )
   {
      
      //Insert code here.
   }

};

import System.*;
import System.Runtime.InteropServices.*;

public class MyClassThatNeedsToRegister
{
    /** @attribute ComRegisterFunctionAttribute()
     */
    public static void RegisterFunction(Type
 t)
    {
        //Insert code here.
    } //RegisterFunction

    /** @attribute ComUnregisterFunctionAttribute()
     */
    public static void UnregisterFunction(Type
 t)
    {
        //Insert code here.
    } //UnregisterFunction
} //MyClassThatNeedsToRegister
import System;
import System.Runtime.InteropServices;

public class MyClassThatNeedsToRegister
{
   ComRegisterFunctionAttribute public static
 function RegisterFunction(t : Type) : void
 
   {
      //Insert code here.
   }
   
   ComUnregisterFunctionAttribute public static
 function UnregisterFunction(t : Type) : void
   {
      //Insert code here.
   }
}
継承階層継承階層
System.Object
   System.Attribute
    System.Runtime.InteropServices.ComRegisterFunctionAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ComRegisterFunctionAttribute メンバ
System.Runtime.InteropServices 名前空間
ComUnregisterFunctionAttribute
RegisterAssembly
その他の技術情報
アセンブリ登録ツール (Regasm.exe)

ComRegisterFunctionAttribute コンストラクタ

ComRegisterFunctionAttribute クラス新しインスタンス初期化します。

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

Dim instance As New ComRegisterFunctionAttribute
public ComRegisterFunctionAttribute ()
public:
ComRegisterFunctionAttribute ()
public ComRegisterFunctionAttribute ()
public function ComRegisterFunctionAttribute
 ()
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ComRegisterFunctionAttribute クラス
ComRegisterFunctionAttribute メンバ
System.Runtime.InteropServices 名前空間

ComRegisterFunctionAttribute プロパティ


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

  名前 説明
パブリック プロパティ TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。 ( Attribute から継承されます。)
参照参照

関連項目

ComRegisterFunctionAttribute クラス
System.Runtime.InteropServices 名前空間
ComUnregisterFunctionAttribute
RegisterAssembly

その他の技術情報

アセンブリ登録ツール (Regasm.exe)

ComRegisterFunctionAttribute メソッド


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

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

関連項目

ComRegisterFunctionAttribute クラス
System.Runtime.InteropServices 名前空間
ComUnregisterFunctionAttribute
RegisterAssembly

その他の技術情報

アセンブリ登録ツール (Regasm.exe)

ComRegisterFunctionAttribute メンバ

アセンブリCOM から使用できるように登録するときに呼び出すメソッド指定します。これにより、登録処理中にユーザー記述コード実行できるようになります

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


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

関連項目

ComRegisterFunctionAttribute クラス
System.Runtime.InteropServices 名前空間
ComUnregisterFunctionAttribute
RegisterAssembly

その他の技術情報

アセンブリ登録ツール (Regasm.exe)



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

辞書ショートカット

すべての辞書の索引

「ComRegisterFunctionAttribute」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS