1. integer array pass parameter
2. String parameter string return value
3. Modify the content of the incoming string
4. Array parameters
5. Introduction of 5.idispatch interface
6. Modify the contents of the input array
7. Add array contents
8.JS's array pass parameter calls S4Execute ().
1.
Use the inbound/outbound buffer that requires the array parameter S4 execute ().
2.
The array element types such as JS plastic data Byte/ Short/ Int are all int (COMVT_I4 where I stands for plastic and 4 stands for 4 bytes).
3.
JSArrayCOM implements the operation of IDispatch image through IDispatch interface api. See the introduction to IDispatch in the section.
4.
Com++ definition
Introduction to IDispatch interface
1.
The caller of C program call must know the interface specification (parameter type, parameter byte degree, parameter order, etc. ) in advance. Because some specifications of the same language are not solved by the same COM, an IDispatch interface is provided.
2.
IDispatch requires that its instance must be self-describing, that is, the calling method of directly obtaining images must be clear in advance.
3.
IDispatch specifies the relevant type through VT_TYPE.
VT_I44 byte shaping, VT_BSTRunicode string VT_DISPATCH represents IDispatch image.
4.
Assign an integer Id string to each property or function (method). The caller decides how to call through the name string. If the name "length" attribute is understood by the caller, the description of the corresponding attribute name should be accurate enough. The "length ()" name function realizes the integer addition function just right.
5.
Using idispatch as prime minister, call IDispatch::GetIDsOfNames () property and function name as parameters to get the property and function ID.
6.
Then call IDispatch::Invoke() id as a parameter to actually call the function.
7.
If the property value is obtained, Invoke () calls to pass in the Dispatch_PropertyGet flag.
8.
If the property value is set, Invoke () will call the incoming Dispatch_PropertyPut flag and.
The disparams parameter specifies how to modify this property. For a description of the display program structure, see.
9.
If the function is called, an Invoke () call is passed in.
If the method requires parameters, the Dispatch_Method flag is specified by the idispatch:: invoke () dispatches parameter.
Modify the contents of the input array
1.
The fifth section introduces how JS passes the array parameters to COM and how COM obtains the parameters. This section describes how COM modifies the array passed by JS.
2.
To modify the JS array value, first get the dispid and get the of the specified serial number element through GetIDsOfNames; Call Invoke () and pass in the Dispatch_PropertyPut flag to indicate the write operation, and the dispatches structure indicates the element value of the element type.