RegistrationServices 类

定义

提供一组用于注册和注销托管程序集以供从 COM 使用的服务。Provides a set of services for registering and unregistering managed assemblies for use from 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.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.ComVisible(true)]
[System.Runtime.InteropServices.Guid("475e398f-8afa-43a7-a3be-f4ef8d6787c9")]
public class RegistrationServices : System.Runtime.InteropServices.IRegistrationServices
type RegistrationServices = class
    interface IRegistrationServices
Public Class RegistrationServices
Implements IRegistrationServices
继承
RegistrationServices
属性
实现

注解

当 COM 客户端使用程序集中的对象时,需要注册。Registration is needed when the objects within an assembly are being used by COM clients. Regasm (程序集注册工具)Microsoft Visual Studio 2005Microsoft Visual Studio 2005 使用 RegistrationServices 类公开的方法来添加或删除托管程序集的启用 COM 的注册表项。The Regasm.exe (Assembly Registration Tool) and Microsoft Visual Studio 2005Microsoft Visual Studio 2005 use methods exposed by the RegistrationServices class to add or remove COM-enabling registry entries for managed assemblies.

你可以使用以下方法来帮助你准备注册文件:You can use the following methods to assist you in preparing a registration file:

尽管这些方法有助于收集要在注册文件中使用的信息,但它们实际上并不生成注册文件。Although these methods help in gathering information to be used in a registration file, they do not actually produce a registration file. 相反,你可以使用Regasm (程序集注册工具)工具和 /regfile 选项来执行此任务。Instead, you can use the Regasm.exe (Assembly Registration Tool) tool with the /regfile option to perform this task. RegistrationServices 方法不能导出和注册类型库。RegistrationServices methods cannot export and register a type library. 若要导出和注册类型库,可以使用Regasm (程序集注册工具)工具和Tlbexp.exe (类型库导出程序)工具。To export and register a type library, you can use the Regasm.exe (Assembly Registration Tool) tool and the Tlbexp.exe (Type Library Exporter) tool.

构造函数

RegistrationServices()

初始化 RegistrationServices 类的新实例。Initializes a new instance of the RegistrationServices class.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetManagedCategoryGuid()

返回包含托管类的 COM 类别的 GUID。Returns the GUID of the COM category that contains the managed classes.

GetProgIdForType(Type)

检索指定类型的 COM ProgID。Retrieves the COM ProgID for the specified type.

GetRegistrableTypesInAssembly(Assembly)

在通过调用 RegisterAssembly(Assembly, AssemblyRegistrationFlags) 注册的程序集中检索类的列表。Retrieves a list of classes in an assembly that would be registered by a call to RegisterAssembly(Assembly, AssemblyRegistrationFlags).

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

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

注册托管程序集中的类以便能从 COM 创建。Registers the classes in a managed assembly to enable creation from COM.

RegisterTypeForComClients(Type, Guid)

使用指定的 GUID 向 COM 注册指定的类型。Registers the specified type with COM using the specified GUID.

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

使用指定的执行上下文和连接类型向 COM 注册指定的类型。Registers the specified type with COM using the specified execution context and connection type.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
TypeRepresentsComType(Type)

指示类型是否用 ComImportAttribute 进行了标记,或者派生带有 ComImportAttribute 标记的类型并且与父级具有相同的 GUID。Indicates whether a type is marked with the ComImportAttribute, or derives from a type marked with the ComImportAttribute and shares the same GUID as the parent.

TypeRequiresRegistration(Type)

确定指定的类型是否需要注册。Determines whether the specified type requires registration.

UnregisterAssembly(Assembly)

注销托管程序集中的类。Unregisters the classes in a managed assembly.

UnregisterTypeForComClients(Int32)

删除对使用 RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) 方法注册的类型的引用。Removes references to a type registered with the RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) method.

适用于

另请参阅