RegistrationServices.RegisterTypeForComClients Metod

Definition

Registrerar den angivna typen med COM.

Överlagringar

Name Description
RegisterTypeForComClients(Type, Guid)

Registrerar den angivna typen med COM med det angivna GUID:et.

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

Registrerar den angivna typen med COM med den angivna körningskontexten och anslutningstypen.

Kommentarer

Observera att användning av plattformsanrop för att anropa ohanterade CoRegisterClassObject metoder och CoDisconnectObject metoder för registrering och avregistrering av COM-objekt inte stöds.

RegisterTypeForComClients(Type, Guid)

Registrerar den angivna typen med COM med det angivna GUID:et.

public:
 virtual void RegisterTypeForComClients(Type ^ type, Guid % g);
public virtual void RegisterTypeForComClients(Type type, ref 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
[<System.Security.SecurityCritical>]
abstract member RegisterTypeForComClients : Type * Guid -> unit
override this.RegisterTypeForComClients : Type * Guid -> unit
Public Overridable Sub RegisterTypeForComClients (type As Type, ByRef g As Guid)

Parametrar

type
Type

Som Type ska registreras för användning från COM.

g
Guid

Används Guid för att registrera den angivna typen.

Implementeringar

Attribut

Undantag

Parametern type är null.

Det går inte att skapa parametern type .

Kommentarer

Den här metoden motsvarar anrop CoRegisterClassObject i COM. Metoden RegisterTypeForComClients är inte atomisk och kan orsaka oförutsägbara resultat när den används i en flertrådad kontext.

I version 2.0 och senare använder du UnregisterTypeForComClients metoden för att avregistrera en typ i COM.

Observera att användning av plattformsanrop för att anropa ohanterade CoRegisterClassObject metoder och CoDisconnectObject metoder för registrering och avregistrering av COM-objekt inte stöds.

Se även

Gäller för

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

Registrerar den angivna typen med COM med den angivna körningskontexten och anslutningstypen.

public:
 virtual int RegisterTypeForComClients(Type ^ type, System::Runtime::InteropServices::RegistrationClassContext classContext, System::Runtime::InteropServices::RegistrationConnectionType flags);
[System.Runtime.InteropServices.ComVisible(false)]
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);
[<System.Runtime.InteropServices.ComVisible(false)>]
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
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
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
Public Overridable Function RegisterTypeForComClients (type As Type, classContext As RegistrationClassContext, flags As RegistrationConnectionType) As Integer

Parametrar

type
Type

Objektet Type som ska registreras för användning från COM.

classContext
RegistrationClassContext

Ett av de RegistrationClassContext värden som anger kontexten där den körbara koden ska köras.

flags
RegistrationConnectionType

Ett av de RegistrationConnectionType värden som anger hur anslutningar görs till klassobjektet.

Returer

Ett heltal som representerar ett cookievärde.

Attribut

Undantag

Parametern type är null.

Det går inte att skapa parametern type .

Kommentarer

Den här metoden motsvarar anrop CoRegisterClassObject i COM. Metoden RegisterTypeForComClients är inte atomisk och kan orsaka oförutsägbara resultat när den används i en flertrådad kontext.

I .NET Framework version 2.0 och senare använder du metoden UnregisterTypeForComClients för att avregistrera en typ i COM.

Observera att användning av plattformsanrop för att anropa ohanterade CoRegisterClassObject metoder och CoDisconnectObject metoder för registrering och avregistrering av COM-objekt inte stöds.

Gäller för