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#