VBScript/JavaScript and COM Data Transmission

Source: Internet
Author: User

We often encounter multiple parameters defined in the script packaged into an array, and then passed the array to a component method. The methods for defining arrays in JavaScript and VBScript are different. The arrays in VBScript use the automatic compatible type safearray, which is convenient to traverse. The secret weapon of JavaScript dynamic scripts-The idispatchex Interface
For a basic object, you can dynamically add or delete attributes and methods, or generate a custom Class Based on an idispatchex interface. Idispatchex is an extension of idispatch, which is tailored to some dynamic features of dynamic scripts. Besides providing all the methods of the idispatch interface, idispatchex also provides the following features:

    • Add new members to an object ("expando")-UseGetdispidWithFdexnameensureFlag.

    • Delete members of an object-UseDeletememberbynameOrDeletememberbydispid.

    • Case-sensitive dispatch operations-UseFdexnamecasesensitiveOrFdexnamecaseinsensitive.

    • Search for member with implicit name-UseFdexnameimplicit.

    • EnumerateDispidS of an object-UseGetnextdispid.

    • Map fromDispidTo element name-UseGetmembername.

    • Obtain properties of object members-UseGetmemberproperties.

    • Method invocationThisPointer-UseInvokeexWithDispatch_method.

Allow browsers that support the concept of name spaces to obtain the name space parent of an object-UseGetnamespaceparent.

,

Interaction between ActiveX components and JavaScript
Http://hi.baidu.com/huhe/blog/item/817a59ee1ca423f8b3fb95de.html
Describes connection points, data transmission, and so on.

For VB safearray, we recommend that you use the ccomsafearray and ccomvariant classes of ATL.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.