CustomAssistantBase Class
The base class for objects that enable Custom Servers in the UFT context to run code in the AUT context.
Object Model
CustomAssistantBase Class

CustomAssistantBase is the base class for all Record and Replay assistant classes. Assistant class objects are created and run in the AUT context. They help Custom Server objects created in UFT context run parts of their code in the AUT context, thereby gaining direct access to the exposed methods, events, and data of the customized Control. These classes are used only in the UFT context.

Setting up an Assistant Class

Create the Assistant class.

                    class MyRemoteAssistant : CustomAssistantBase
                        public int Add(int i, int j)

Create the remote object with CustomServerBase.CreateRemoteObject.

                MyRemoteAssistant oMyAssistant = 

Set the target control once before the first use.


Invoking Methods of an Assistant Class

Assistant class methods can be invoked directly if they can run in any thread of the AUT.

             int  i = oMyAssistant.Add(1,2);

Indirect invocation with CustomServerBase.InvokeAssistant causes a method to run in the Control's thread.

             int  i = (int)InvokeAssistant(oMyAssistant, "Add", 1, 2);

Public Class CustomAssistantBase 
   Inherits System.MarshalByRefObject
public class CustomAssistantBase : System.MarshalByRefObject 
Inheritance Hierarchy


Protected Constructors
Protected ConstructorCustomAssistantBase ConstructorDefault constructor.  
Protected Properties
Protected PropertyTargetControlReturns the custom control object.  
Public Methods
Public MethodGetInprocObjRefThis method supports the UFT infrastructure. Do not override it and do not invoke it directly in your code.  
Public MethodInitializeLifetimeServiceOverridden. Prevents your Custom Server from timing out. Do not change or override this implementation.  
Public MethodSetTargetControlAttaches to the target custom control object.