pass a COM object reference to a WSC component 
Author Message
 pass a COM object reference to a WSC component

I would like to use WSC components to access legacy COM
objects methods on existing instances.

My problem is to pass a reference to an existing COM (ATL)
object instance (out of the WSC) instead of creating a new
one in the WSC component before being able to use it.

Is this possible ? How ?

Typically, i would like to be able to write a WSC method
like:

function (myCOMObjectRef as ActiveXObject("blabla.blabla"))
{
  return myCOMObjectRef.myComATLMethod("blurp");

Quote:
}



Mon, 26 Jul 2004 23:21:51 GMT  
 pass a COM object reference to a WSC component
The WSC method...

function MyWscMethod(myCOMObjectRef)
{
  return myCOMObjectRef.myComATLMethod("blurp");

Quote:
}

The code in the caller...

foo = new ActiveXObject("blabla.blabla");
myWscObject.MyWscMethod(foo);

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> I would like to use WSC components to access legacy COM
> objects methods on existing instances.

> My problem is to pass a reference to an existing COM (ATL)
> object instance (out of the WSC) instead of creating a new
> one in the WSC component before being able to use it.

> Is this possible ? How ?

> Typically, i would like to be able to write a WSC method
> like:

> function (myCOMObjectRef as ActiveXObject("blabla.blabla"))
> {
>   return myCOMObjectRef.myComATLMethod("blurp");
> }



Tue, 27 Jul 2004 05:47:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Attach events of the external COM-object from WSC component

2. Passing by reference to an ATL COM component

3. Passing optional object arguments from COM components

4. Passing a variable by reference in a COM object

5. Pass a reference to a COM object

6. Passing COM objects by reference

7. passing references to COM objects in script

8. Passing an object reference by reference where the object has a default property

9. How does a WSC component reference itself?

10. Referencing a COM object on a different machine than the wsc component???

11. CAlling C++ COM Component with reference paramater

12. Using WScript object in WSC components

 

 
Powered by phpBB® Forum Software