Passing more than one parameter to the script callback

Passing more than one parameter to JScript function isn’t difficult at all after knowing how to pass the parameter. But there is only one trickier part here. I haven’t investigated why this is trickier but it is this way and one must know this other wise the results can be confusing.   Lets say out…

2

Using Return Value of the Script Callback

To use the return value of the JScript Function we need to pass parameter VARIANT *pVarResult to the Invoke Method of the IDispatch.   Lets implement an adder that takes one integer as parameter and return the result as paramter + 1. function adder(a) {     alert(“a = “ + a);     return a +…

1

Passing Parameter to the Script Callback

Earlier post talked about how to call a callback script from the COM component. What if one wants to call a function that takes parameter say alerter. function alerter(b) {     alert(“b = “ + b); }   Now to call this function we need to use other parameters of Invoke method of IDispatch which…

1

Script CallBack from COM

Earlier we saw how to call a function on COM class from JScript. But what if one wants to call a function say a callback which is in JScript from COM? Lets see how to achieve this in this post.   To make COM and JScript interoperable and allow COM component to call JScript function…

1

Calling functions of COM object from JScript

After earlier post on instantiating COM class, let’s move ahead with invoking the functions over this COM object.   To be able to invoke functions on the instantiated COM function through JScript, we need to add the method to the ITest interface which is derived from IDispatch. Lets start with a example of a COM…

4

Interoperability of JScript with COM

Recently I worked on using COM component in JScript. I couldn’t find one stop solution or example for this and so thought for writing series of posts regarding this.   Instantiating a COM class. COM class should implement IDispatch and be registered with ProgID, so that JScript can invoke it using ActiveXObject semantics.   I…

1