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.