แก้ไข

แชร์ผ่าน


RegistrationServices Class

Definition

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.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.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
Public Class RegistrationServices
Implements IRegistrationServices
Inheritance
RegistrationServices
Attributes
Implements

Remarks

Registration is needed when the objects within an assembly are being used by COM clients. The Regasm.exe (Assembly Registration Tool) and Microsoft 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. Instead, you can use the Regasm.exe (Assembly Registration Tool) tool with the /regfile option to perform this task. RegistrationServices methods cannot export and register a type library. 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.

Constructors

RegistrationServices()

Initializes a new instance of the RegistrationServices class.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetManagedCategoryGuid()

Returns the GUID of the COM category that contains the managed classes.

GetProgIdForType(Type)

Retrieves the COM ProgID for the specified type.

GetRegistrableTypesInAssembly(Assembly)

Retrieves a list of classes in an assembly that would be registered by a call to RegisterAssembly(Assembly, AssemblyRegistrationFlags).

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterAssembly(Assembly, AssemblyRegistrationFlags)

Registers the classes in a managed assembly to enable creation from COM.

RegisterTypeForComClients(Type, Guid)

Registers the specified type with COM using the specified GUID.

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

Registers the specified type with COM using the specified execution context and connection type.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
TypeRepresentsComType(Type)

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)

Removes references to a type registered with the RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) method.

Applies to

See also