EnterpriseServicesHelper.SwitchWrappers(RealProxy, RealProxy) Method

Definition

Switches a COM Callable Wrapper (CCW) from one instance of a class to another instance of the same class.

C#
public static void SwitchWrappers(System.Runtime.Remoting.Proxies.RealProxy oldcp, System.Runtime.Remoting.Proxies.RealProxy newcp);
C#
[System.Security.SecurityCritical]
public static void SwitchWrappers(System.Runtime.Remoting.Proxies.RealProxy oldcp, System.Runtime.Remoting.Proxies.RealProxy newcp);

Parameters

oldcp
RealProxy

A proxy that represents the old instance of a class that is referenced by a CCW.

newcp
RealProxy

A proxy that represents the new instance of a class that is referenced by a CCW.

Attributes

Exceptions

The immediate caller does not have UnmanagedCode permission.

Remarks

Caution

This method can cause unwanted behavior. Before calling it, the user must ensure that this is a thread-safe operation, and that a call is not being made through the CCW to one of the instances of the class.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1