Defines information used to register the script component as a COM component.
|
---|
<registration progid="progID" classid="GUID" description="description"
version="version" [remotable=remoteFlag]/>
–or–
<registration progid="progID" classid="GUID" description="description"
version="version" [remotable=remoteFlag]>
<script>
(registration and unregistration script)
</script>
</registration> |
Values
- progID
(Optional) A text name that programmers use to reference your script component when creating an instance of it. For example, if your script component's program ID is Component.MyComponent, you can create an instance of it in Microsoft® Visual Basic using a statement such as the following:
Set Component = CreateObject("Component.MyComponent")
Note |
---|
Although a progid attribute is optional, you must include either a progid or a classid attribute (you can include both). If only the progid attribute is specified, the class ID is generated automatically. If only the class ID is created, then no progid is registered and the object can be created only by referencing the class ID directly. |
- GUID
(Optional) A GUID that you have generated using a class ID generation program (such as Uuidgen.exe). If you do not include a class ID, the registration program assigns a class ID to your script component.
- description
(Optional) A text description of the script component that is stored in the registry and that is used in certain tools such as the Visual Basic object browser.
- version
(Optional) A numeric version number that you assign. The version is appended to the program ID with a period (for example, MyComponent.1) when applications request a version-specific name. Use only numbers (decimal points are not allowed).
Note |
---|
The registration attributes can appear in any order in the <registration> element. |
- remoteFlag
(Optional) A Boolean value indicating whether the script component can be instantiated remotely using DCOM. For details, Using a Using a Script Component in an Application.
Remarks
Example
The following shows a typical <registration> element that includes both a prog ID and a class ID.
| Copy Code |
---|
<registration
progid="Component.TestScript"
classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}"
description="My Test Component"
version="1"/> |
The following registration element allows the script component to be instantiated via DCOM:
| Copy Code |
---|
<registration>
progid="Component.TestScript"
classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}"
version="1"
description="My Test Component"
remotable=true/> |
The following example shows a <registration> element that includes script to be run when the script component is registered and unregistered.
| Copy Code |
---|
<registration
progid="Component.TestScript"
classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}">
version="1"
description="My Test Component">
<script language="VBScript">
Function register()
MsgBox "Component 'My Test Component' registered."
End Function
Function unregister()
MsgBox "Component 'My Test Component' unregistered."
End Function
</script>
]]>
</registration> |
See Also