
Microsoft® ActiveX Scripting introduces a new way for an application to add scripting and OLE Automation capabilities. With the advent of ActiveX Scripting, hosts can call upon disparate scripting engines from multiple sources and vendors to perform scripting between components. The implementation of the script itselflanguage, syntax, persistent format, execution model, and so onis left to the script vendor. The designers have taken care to allow hosts that rely on ActiveX Scripting to use arbitrary language back ends.
Active Script Debugging Interfaces
ActiveX Scripting Terms
This list contains definitions of the scripting-related terms used in this document.
| Term | Definition |
| Code object | An instance created by the scripting engine that is associated with a named item, such as the module behind a form in Visual Basic®, or a C++ class associated with a named item. Preferably, this is an OLE Component Object Model (COM) object that supports OLE Automation so the host or other nonscript entity can manipulate the code object. |
| Named item | An OLE COM object (preferably one that supports OLE Automation) that the host deems interesting to the script. Examples include the HTML Page and Browser in a Web browser, and the Document and Dialogs in Microsoft Word. |
| Script | The data that makes up the program that the scripting engine runs. A script can be any contiguous executable data, including pieces of text, blocks of pcode, or even machine-specific executable byte codes. A host loads a script into the scripting engine through one of the IPersist* interfaces or through the IActiveScriptParse interface. |
| Scripting engine | The OLE object that processes scripts. A scripting engine implements the IActiveScript and, optionally, IActiveScriptParse interfaces. |
| Scripting host | The application or program that owns the ActiveX Scripting engine. The host implements the IActiveScriptSite and, optionally, IActiveScriptSiteWindow interfaces. |
| Scriptlet | A portion of a script that gets attached to an object through the IActiveScriptParse interface. The aggregate collection of scriptlets is the script. |
| Script language | The language in which a script is written (VBScript, for example) and the semantics of that language. |
ActiveX Scripting Background
ActiveX Scripting components fall into two categories: ActiveX Scripting hosts and ActiveX Scripting engines. A host creates a scripting engine and calls on the engine to run the scripts. Examples of ActiveX Scripting hosts include:
ActiveX Scripting engines can be developed for any language or run-time environment, including:
To make implementation of the host as flexible as possible, an OLE Automation wrapper for ActiveX Scripting is provided. However, a host that uses this wrapper object to instantiate the scripting engine does not have the degree of control over the run-time name space, the persistence model, and so on, that it would if it used ActiveX Scripting directly.
The ActiveX Scripting design isolates the interface elements required only in an authoring environment so that nonauthoring hosts (such as browsers and viewers) and script engines (for example, VBScript) can be kept lightweight.
ActiveX Scripting Basic Architecture
The following illustration shows the interaction between an ActiveX Scripting host and an ActiveX Scripting engine.
Following is a description of the steps involved in the interaction between the host and engine. The actual nesting of the function calls is omitted for clarity.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.