当前位置:编程学习 > C#/ASP.NET >>

ComRegisterFunctionAttribute怎么用?

MSDN给的例子是这样的:

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.
   }
}

说这样使用regasm.exe注册(注销)这个Assembly的时候RegisterFunction(UnregisterFunction)会被自动调用。试了一下,貌似不行。有哪为用过的指点一下就给分。
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,