RealProxy.CreateObjRef(Type) 方法

定义

为指定的对象类型创建 ObjRef,并将其作为客户端激活的对象注册到远程处理结构。

public:
 virtual System::Runtime::Remoting::ObjRef ^ CreateObjRef(Type ^ requestedType);
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
[System.Security.SecurityCritical]
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
[<System.Security.SecurityCritical>]
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
Public Overridable Function CreateObjRef (requestedType As Type) As ObjRef

参数

requestedType
Type

为其创建 ObjRef 的对象类型。

返回

为指定类型创建的 ObjRef 的新实例。

属性

示例

virtual ObjRef^ CreateObjRef( Type^ ServerType ) override
{
   Console::WriteLine( "CreateObjRef Method Called ..." );
   CustomObjRef ^ myObjRef = gcnew CustomObjRef( myMarshalByRefObject,ServerType );
   myObjRef->URI = myUri;
   return myObjRef;
}
public override ObjRef CreateObjRef(Type ServerType)
{
   Console.WriteLine ("CreateObjRef Method Called ...");
   CustomObjRef myObjRef = new CustomObjRef(myMarshalByRefObject,ServerType);
   myObjRef.URI = myUri ;
   return myObjRef;
}
Public Overrides Function CreateObjRef(ServerType As Type) As ObjRef
   Console.WriteLine("CreateObjRef Method Called ...")
   Dim myObjRef As New CustomObjRef(myMarshalByRefObject, ServerType)
   myObjRef.URI = myUri
   Return myObjRef
End Function 'CreateObjRef

适用于

另请参阅