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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ComUnregisterFunctionAttribute クラスの意味・解説 

ComUnregisterFunctionAttribute クラス

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

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

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

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

ComUnregisterFunctionAttribute使用すると、登録メソッド実行した操作元に戻すためのコード追加できます。ComRegisterFunctionAttribute を適用して登録メソッド提供する場合は、その登録メソッド実行され操作元に戻すための登録解除メソッド提供する必要があります。登録解除メソッドは 1 クラスにつき 1 つしか提供できません。

格納しているアセンブリアセンブリ登録ツール (Regasm.exe) や RegistrationServices.UnregisterAssembly API メソッド使用して (直接または間接的に) 登録解除される場合共通言語ランタイムはこの属性を持つメソッド呼び出します。この属性を持つメソッド参照可能範囲 (パブリックプライベートなど) は任意ですが、このメソッドstatic である必要があり、登録解除する Type を表す 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.ComUnregisterFunctionAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ComUnregisterFunctionAttribute メンバ
System.Runtime.InteropServices 名前空間
ComRegisterFunctionAttribute クラス
RegistrationServices.UnregisterAssembly
その他の技術情報
アセンブリ登録ツール (Regasm.exe)



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

辞書ショートカット

すべての辞書の索引

「ComUnregisterFunctionAttribute クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS