Method AutomationObject():dynamicCast() Foundation
Converts (casts) an AutomationObject instance to another class.
:dynamicCast( <xClass> ) --> o
This method returns the object cast to the automation class specified.
The class AutomationObject is the generic base class for all automation and ActiveX objects. Instances of the AutomationObject class are used to connect to a COM/ActiveX component in order to access its methods and properties. Likewise, of a COM object is returned as the result of a method call, it is returned as an object of the AutomationObject class.
When working with COM/ActiveX components, an application often uses subclasses of the AutomationObject class to communicate with the COM/ActiveX component. If the application needs to respond to COM events, for example, an object of class ActiveXObject is required. Likewise, writing wrapper classes for COM/ActiveX objects often involves exposing specialized methods or instance variables. This introduces the requirement to cast an AutomationObject to an instance of another automation class. For this, the method :dynamicCast() can be used.
The method :dynamicCast() creates an instance of the class passed in parameter <xClass> and connects it to the COM/ActiveX object.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.