Compartir a través de


Método RegistrationServices.RegisterTypeForComClients (Type, RegistrationClassContext, RegistrationConnectionType)

 

Publicado: octubre de 2016

Registra el tipo especificado con COM utilizando el contexto de ejecución especificado y el tipo de conexión.

Espacio de nombres:   System.Runtime.InteropServices
Ensamblado:  mscorlib (en mscorlib.dll)

Sintaxis

[SecurityCriticalAttribute]
[ComVisibleAttribute(false)]
public virtual int RegisterTypeForComClients(
    Type type,
    RegistrationClassContext classContext,
    RegistrationConnectionType flags
)
public:
[SecurityCriticalAttribute]
[ComVisibleAttribute(false)]
virtual int RegisterTypeForComClients(
    Type^ type,
    RegistrationClassContext classContext,
    RegistrationConnectionType flags
)
[<SecurityCriticalAttribute>]
[<ComVisibleAttribute(false)>]
abstract RegisterTypeForComClients : 
        type:Type *
        classContext:RegistrationClassContext *
        flags:RegistrationConnectionType -> int
[<SecurityCriticalAttribute>]
[<ComVisibleAttribute(false)>]
override RegisterTypeForComClients : 
        type:Type *
        classContext:RegistrationClassContext *
        flags:RegistrationConnectionType -> int
<SecurityCriticalAttribute>
<ComVisibleAttribute(False)>
Public Overridable Function RegisterTypeForComClients (
    type As Type,
    classContext As RegistrationClassContext,
    flags As RegistrationConnectionType
) As Integer

Parámetros

  • type
    Type: System.Type

    La Type objeto que se va a registrar para utilizarlo desde COM.

Valor devuelto

Type: System.Int32

Un entero que representa el valor de una cookie.

Excepciones

Exception Condition
ArgumentException

El parámetro type es null.

ArgumentNullException

El type no se puede crear el parámetro.

Comentarios

Este método es equivalente a llamar a CoRegisterClassObject en COM. El RegisterTypeForComClients método no es atómico y puede producir resultados imprevisibles cuando se utiliza en un contexto multiproceso.

En .NET Framework 2.0 y versiones posteriores, utilice el UnregisterTypeForComClients método anular el registro de un tipo en COM.

Tenga en cuenta que mediante invocación de plataforma para llamar a la no administrada CoRegisterClassObject y CoDisconnectObject no se admiten métodos de registro y anulación del registro de objetos COM.

Seguridad

SecurityCriticalAttribute

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Información de versión

.NET Framework
Disponible desde 2.0

Ver también

RegisterTypeForComClients Sobrecarga
Clase RegistrationServices
Espacio de nombres System.Runtime.InteropServices

Volver al principio