RegistrationServices.RegisterTypeForComClients Method

Definition

Registers the specified type with COM.

Overloads

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.

Remarks

Note that using platform invoke to call the unmanaged CoRegisterClassObject and CoDisconnectObject methods for registration and unregistration of COM objects is not supported.

RegisterTypeForComClients(Type, Guid)

Registers the specified type with COM using the specified GUID.

public:
 virtual void RegisterTypeForComClients(Type ^ type, Guid % g);
[System.Security.SecurityCritical]
public virtual void RegisterTypeForComClients (Type type, ref Guid g);
abstract member RegisterTypeForComClients : Type * Guid -> unit
override this.RegisterTypeForComClients : Type * Guid -> unit

Parameters

type
Type

The Type to be registered for use from COM.

g
Guid

The Guid used to register the specified type.

Implements

Attributes

Exceptions

The type parameter is null.

The type parameter cannot be created.

Remarks

This method is equivalent to calling CoRegisterClassObject in COM. The RegisterTypeForComClients method is not atomic and can cause unpredictable results when used in a multithreaded context.

In version 2.0 and later, use the UnregisterTypeForComClients method to unregister a type in COM.

Note that using platform invoke to call the unmanaged CoRegisterClassObject and CoDisconnectObject methods for registration and unregistration of COM objects is not supported.

Security

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

See also

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

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

public:
 virtual int RegisterTypeForComClients(Type ^ type, System::Runtime::InteropServices::RegistrationClassContext classContext, System::Runtime::InteropServices::RegistrationConnectionType flags);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public virtual int RegisterTypeForComClients (Type type, System.Runtime.InteropServices.RegistrationClassContext classContext, System.Runtime.InteropServices.RegistrationConnectionType flags);
abstract member RegisterTypeForComClients : Type * System.Runtime.InteropServices.RegistrationClassContext * System.Runtime.InteropServices.RegistrationConnectionType -> int
override this.RegisterTypeForComClients : Type * System.Runtime.InteropServices.RegistrationClassContext * System.Runtime.InteropServices.RegistrationConnectionType -> int

Parameters

type
Type

The Type object to register for use from COM.

classContext
RegistrationClassContext

One of the RegistrationClassContext values that indicates the context in which the executable code will be run.

flags
RegistrationConnectionType

One of the RegistrationConnectionType values that specifies how connections are made to the class object.

Returns

An integer that represents a cookie value.

Attributes

Exceptions

The type parameter is null.

The type parameter cannot be created.

Remarks

This method is equivalent to calling CoRegisterClassObject in COM. The RegisterTypeForComClients method is not atomic and can cause unpredictable results when used in a multithreaded context.

In the .NET Framework version 2.0 and later, use the UnregisterTypeForComClients method to unregister a type in COM.

Note that using platform invoke to call the unmanaged CoRegisterClassObject and CoDisconnectObject methods for registration and unregistration of COM objects is not supported.

Security

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

Applies to