Home  >  Article  >  Web Front-end  >  Steps to write COM components in JavaScript_javascript tips

Steps to write COM components in JavaScript_javascript tips

WBOY
WBOYOriginal
2016-05-16 18:55:241551browse

Scripting languages ​​that support these interfaces include: JavaScript/JScript, VBScript, Perl and Python, etc.
WSC has the following characteristics.
Ø Small and efficient;
Ø Easy to create, maintain and deploy;
Ø Provides the ability to create COM components;
Ø Provides the ability to access a large number of system services.
The core work of writing COM components in JavaScript is to complete a .wsc (Windows Scripting Component) file. The .wsc file is a standard XML file with the following format:



description="Description"
progid ="Program ID"
version="Version number"
classid="Type ID" remotable="true">










Describes the previously defined method or attribute name
]]>






The entire .wsc file consists of component declaration, method and attribute declaration, method and attribute description, method implementation, etc. The process of writing COM components using scripting languages ​​such as VBScript or JavaScript is the process of completing the .wsc file. Note: The execution performance of COM components written using scripting languages ​​such as VBScript or JavaScript cannot be compared with COM using executable binary files such as .dll and .ocx as carriers. Because scripting languages ​​cannot be compiled, but can only run on the host. The scripting host on the Windows platform is WSH (Windows Scripting Host), which is WINDOWSsystem32scrobj.dll. Calling a COM component written in a scripting language is actually a process of directly calling WSH and then having WSH execute the script program.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn