ActiveScript Classes
The ActiveScript classes are discussed in the following topics.
The SECAAppObj class defines an application object that you can load from an ActiveScript script. An application object and a form object (SECAFormObj) work together to create new forms or load existing forms. An application object has the member functions that implement form creation and loading. The form object can return the application object that created it. You can also create another form from the returned application object.
The SECAAppObj supports OLE automation and exposes the commands OpenForm, NewForm, and FormByName. You can call these commands from your scripts to invoke the OpenForm(), NewForm(), and FormByName() methods of the SECAAppObj class. SECAAppObj derives from CCmdTarget and implements a dispatch map.
SECAFormObj is an ActiveX control that implements a scriptable form object to link your script to your application. SECAFormObj supports OLE automation and exposes commands for manipulating forms such as Show, Hide, Minimize, GetApp, and more. The GetApp command returns an application object (SECAAppObj) that you can use to create additional forms. In addition, the form defines events that it sends to its container, such as OnLoad and OnUnload.
The script host implemented by the SECAScriptHost class is a COM object that implements the IActiveScriptSite and IActiveScriptSiteWindow interfaces. Microsoft defines the IActiveScriptSite and IActiveScriptSiteWindow interfaces as part of their ActiveScript technology. A script host can create and destroy a script engine (either VBScript or JScript), create a new top level OLE automation object as part of the script, set a reference to the window hosting the script, and parse and execute a script. An application that requires scripting must instantiate a script host and use its pointer to create the scripting engine and execute a script.
The SECAScriptOccManager implements an OLE control container for use with ActiveScript. The class creates a script control site and a script control container. You must instantiate this class in your application’s InitInstance() method to enable support for the containment of ActiveScript controls and hosting COM objects.
IActiveScriptErrorHandler is the basic interface for receiving and handling Active Scripting run-time error notifications. Derive the class that hosts scripts from IActiveScriptErrorHandler and override its HandleError() method.