Windows Script Components  

Creating Registration Information

If the host application requires it, you can register a Windows® Script Component as a COM component using a program such as Regsvr32.exe. Registration places information about the COM component in a public location (in Windows, registration information is stored in the Windows registry). By reading the registration information, applications can find and load the COM component.

Note   Registration is not required in every case. For example, a script component that implements the DHTML Behaviors interface handler in Internet Explorer 5.0 does not need to be registered, because Internet Explorer registers the behaviors as they are detected on the page. For more details about using Behaviors, see the "Using DHTML Behaviors" topic on the Microsoft Site Builder Network (SBN) Web site. If the host application supports monikers, you can also create an instance of a script component without registering it.

When you specify registration, the most important information is:

Registration information also includes a description and a version number.

The registration program can create a class ID for your script component when it is registered. However, it is highly recommended that you provide a class ID for the script component yourself, to ensure that your script component has the same class ID on all computers on which it is registered. Allowing the registration program to create a class ID can also cause problems if you use the script component with development tools that store class IDs. If the registration creates a new class ID each time, it will not match the ID stored by the application.

To create registration information for the script component

Running Script During Registration

The script component <registration> element also allows you to include script that will be executed when the script component is registered and unregistered. For example, you can post a message that the script component has been registered.

To run script during registration and unregistration

Registering for Remote Access

If you are deploying your script component in a distributed environment, you can specify that the script component can be instantiated remotely. For example, you might be creating a script component designed to run on a server, but which will be called from code on a client. This scenario is possible if the client and server machines are properly configured with DCOM, which provides the mechanism for passing object pointers to the client from the server.

To register a script component for remote access

For more details about creating instances of a script component remotely, see Using a Script Component in an Application.

See Also

Script Component File Contents | Using The Script Component Wizard | Creating a Script Component Type Library | Checking For Errors in Script Component Files | Script Component Files and XML Conformance