RegistrationServices 类

定义

提供一组用于注册和注销托管程序集以供从 COM 使用的服务。

public ref class RegistrationServices : System::Runtime::InteropServices::IRegistrationServices
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.Guid("475E398F-8AFA-43a7-A3BE-F4EF8D6787C9")]
public class RegistrationServices : System.Runtime.InteropServices.IRegistrationServices
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.Guid("475E398F-8AFA-43a7-A3BE-F4EF8D6787C9")]
[System.Runtime.InteropServices.ComVisible(true)]
public class RegistrationServices : System.Runtime.InteropServices.IRegistrationServices
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.Guid("475e398f-8afa-43a7-a3be-f4ef8d6787c9")]
public class RegistrationServices : System.Runtime.InteropServices.IRegistrationServices
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.Guid("475E398F-8AFA-43a7-A3BE-F4EF8D6787C9")>]
type RegistrationServices = class
    interface IRegistrationServices
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.Guid("475E398F-8AFA-43a7-A3BE-F4EF8D6787C9")>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type RegistrationServices = class
    interface IRegistrationServices
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Runtime.InteropServices.Guid("475e398f-8afa-43a7-a3be-f4ef8d6787c9")>]
type RegistrationServices = class
    interface IRegistrationServices
Public Class RegistrationServices
Implements IRegistrationServices
继承
RegistrationServices
属性
实现

注解

当 COM 客户端使用程序集中的对象时,需要注册。 Regasm.exe (程序集注册工具) 和 Microsoft Visual Studio 2005 使用由类公开的方法 RegistrationServices 来添加或删除托管程序集的启用 COM 的注册表项。

你可以使用以下方法来帮助你准备注册文件:

尽管这些方法有助于收集要在注册文件中使用的信息,但它们实际上并不生成注册文件。 相反,你可以将 Regasm.exe (程序集注册工具) 工具与用于 /regfile 执行此任务的选项一起使用。 RegistrationServices 方法不能导出和注册类型库。 若要导出和注册类型库,可以使用 Regasm.exe (程序集注册工具) 工具和 Tlbexp.exe (类型库导出程序) 工具。

构造函数

RegistrationServices()

初始化 RegistrationServices 类的新实例。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetManagedCategoryGuid()

返回包含托管类的 COM 类别的 GUID。

GetProgIdForType(Type)

检索指定类型的 COM ProgID。

GetRegistrableTypesInAssembly(Assembly)

在通过调用 RegisterAssembly(Assembly, AssemblyRegistrationFlags) 注册的程序集中检索类的列表。

GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
RegisterAssembly(Assembly, AssemblyRegistrationFlags)

注册托管程序集中的类以便能从 COM 创建。

RegisterTypeForComClients(Type, Guid)

使用指定的 GUID 向 COM 注册指定的类型。

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

使用指定的执行上下文和连接类型向 COM 注册指定的类型。

ToString()

返回表示当前对象的字符串。

(继承自 Object)
TypeRepresentsComType(Type)

指示类型是否用 ComImportAttribute 进行了标记,或者派生带有 ComImportAttribute 标记的类型并且与父级具有相同的 GUID。

TypeRequiresRegistration(Type)

确定指定的类型是否需要注册。

UnregisterAssembly(Assembly)

注销托管程序集中的类。

UnregisterTypeForComClients(Int32)

删除对使用 RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) 方法注册的类型的引用。

适用于

另请参阅