EnterpriseServicesHelper.SwitchWrappers(RealProxy, RealProxy) 方法
定义
在相同类的不同实例中切换 COM 可调用包装 (CCW)。Switches a COM Callable Wrapper (CCW) from one instance of a class to another instance of the same class.
public:
static void SwitchWrappers(System::Runtime::Remoting::Proxies::RealProxy ^ oldcp, System::Runtime::Remoting::Proxies::RealProxy ^ newcp);
public static void SwitchWrappers (System.Runtime.Remoting.Proxies.RealProxy oldcp, System.Runtime.Remoting.Proxies.RealProxy newcp);
[System.Security.SecurityCritical]
public static void SwitchWrappers (System.Runtime.Remoting.Proxies.RealProxy oldcp, System.Runtime.Remoting.Proxies.RealProxy newcp);
static member SwitchWrappers : System.Runtime.Remoting.Proxies.RealProxy * System.Runtime.Remoting.Proxies.RealProxy -> unit
[<System.Security.SecurityCritical>]
static member SwitchWrappers : System.Runtime.Remoting.Proxies.RealProxy * System.Runtime.Remoting.Proxies.RealProxy -> unit
Public Shared Sub SwitchWrappers (oldcp As RealProxy, newcp As RealProxy)
参数
- oldcp
- RealProxy
一个代理,其代表 CCW 所引用类的旧实例。A proxy that represents the old instance of a class that is referenced by a CCW.
- newcp
- RealProxy
一个代理,其代表 CCW 所引用类的新实例。A proxy that represents the new instance of a class that is referenced by a CCW.
- 属性
例外
直接调用方没有 UnmanagedCode 权限。The immediate caller does not have UnmanagedCode permission.
注解
注意
此方法可能会导致不需要的行为。This method can cause unwanted behavior. 在调用该方法之前,用户必须确保这是一个线程安全的操作,并且不会通过 CCW 对该类的一个实例进行调用。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.