Microsoft® Windows® Script Component <implements> Element |
Script Component Reference |
Specifies additional COM interface handlers for a script component.
Syntax
<implements type="COMHandlerName" [id="internalName"] [default=fAssumed]>
handler-specific information here
</implements>
Values
COMHandlerName
The name of the interface handler to reference. Interface handlers are usually implemented as DLLs, which you must be sure are available and registered in the production environment for your script component. Some handlers, such as the Automation and ASP handlers, are built into the script component run-time (Scrobj.dll). Examples of available interface handlers include:
Interface handler Description How implemented ASP Allows a script component to get access to the Microsoft Internet Information Services (IIS) Active Server Pages (ASP) object model. Built into Scrobj.dll DHTML Behaviors Allows a behavior script component to communicate with the containing page so it can fire events and access the DHTML object model. Built into Scrobj.dll
internalName
(Optional) A name you can use to reference the handler in your script. By default, properties, methods, events, and other members of a script component are available in the global namespace. However, if there is a naming conflict between <implements> elements, the names can be disambiguated by prefixing them with the ID of the <implements> element to which they belong, as in the following:
<implements type="Behavior" id="sctBehavior"> [...] </implements> [...] <script language="JScript"> // [...] sctBehavior.fireEvent("onResultChange",oEvent); </script>
fAssumed
(Optional) A Boolean flag indicating that the internalName is assumed in scripts. The default value for this attribute is true, and members of the object model exposed by the handler are added to the global script namespace and can be accessed unqualified. You only need to include this attribute if you want to set it to false and therefore hide members of a specific <implements> element.
Remarks
Interface handlers extend the script component run-time. An interface handler is a compiled component (generally written in C++) that implements specific COM interfaces.
Script components by default implement the COM Automation interface (specifically, the IDispatchEx COM interface). The Automation object's properties, methods, and events are defined in the script component's <public> element. Because the Automation handler is implemented by default, you do not need to implement it with the <implements> element.
Script components can also implement additional COM interfaces by including an <implements> element. Inside the <implements> element, you specify information specific to the interfaces you are implementing. Each interface handler requires different information. For example, a Behavior script component can include <attach> and <layout> elements that are specific to the DHTML Behavior interface.
Example
<implements type="Behavior"> <event name="onResultChange" /> </implements>