Windows Script Components  

Script Component File Contents

Windows® Script Component files are XML (Extensible Markup Language) that are much like HTML files, but contain special elements that define the script component and its behavior. The elements used for defining script components are not HTML tags, but are XML elements specifically used for script component definitions.

A basic script component file contains these elements:

Skeleton Script Component File

The following example illustrates how to construct a script component file.

<?XML version="1.0"?>
<?component error="true" debug="true"?>

      This skeleton shows how script component elements are 
      assembled into a .wsc file.

<component id="MyScriptlet">

   <reference object="progID">

      <property name="propertyname"/>
      <method name="methodname"/>
      <event name="eventname"/>

   <implements type=COMhandlerName id=internalName>
      (interface-specific definitions here)

   <script language="VBScript">
      dim propertyname
      Function methodname()
      ' Script here.
      End Function

   <script language="JScript">
      function get_propertyname()
      { // Script here.
      function put_propertyname(newValue)
      { // Script here.

   <object id="objID" classid="clsid:00000000-0000-0000-000000000000">
   <resource ID="resourceID1">string or number here</resource>
   <resource ID="resourceID2">string or number here</resource>
Note   In XML, you can specify elements without content (attributes only), such as the <property> and <method> elements in the previous example, by closing the element with />.

Note that:

After creating the skeleton, fill in the elements to define the script component's functionality, depending on which interface handler you are implementing.

See Also

Checking For Errors in Script Component Files | Creating a Script Component Type Library | Creating Registration Information | Exposing Events | Exposing Methods | Exposing Properties | Implementing ASP Script Components | Implementing DHTML Behavior Script Components | Script Component Files and XML Conformance | Using the Script Component Wizard