VBScript, COM Events & Safe Arrays 
Author Message
 VBScript, COM Events & Safe Arrays

Has anyone successfully passed a safe array of BSTR's from
an C++ com object via a dispatch interface to a VB or VBScript client
successfully?  If so, how did you do it?  I can receive the array in VB, but
I have to declare the argument as a VARIANT.  In VBScript, I can't reference
it as an array, it does not like it.

Any pointers or help would be appreciated.

TTFN
()z



Fri, 01 Mar 2002 03:00:00 GMT  
 VBScript, COM Events & Safe Arrays
Declare the out parameter in the COM method as a VARIANT*.  This should work
for clients in VB and VBScript

Peter Barber



Quote:
> Has anyone successfully passed a safe array of BSTR's from
> an C++ com object via a dispatch interface to a VB or VBScript client
> successfully?  If so, how did you do it?  I can receive the array in VB,
but
> I have to declare the argument as a VARIANT.  In VBScript, I can't
reference
> it as an array, it does not like it.

> Any pointers or help would be appreciated.

> TTFN
> ()z



Mon, 11 Mar 2002 03:00:00 GMT  
 VBScript, COM Events & Safe Arrays



Quote:
> Has anyone successfully passed a safe array of BSTR's from
> an C++ com object via a dispatch interface to a VB or VBScript client
> successfully?  If so, how did you do it?  I can receive the array in VB,
but
> I have to declare the argument as a VARIANT.  In VBScript, I can't
reference
> it as an array, it does not like it.

> Any pointers or help would be appreciated.

an example code:

CComVariant  vArray;
vArray.vt = VT_ARRAY | VT_VARIANT;

SAFEARRAY *pArray;
pArray = SafeArrayCreate(....
SafeArrayPutElement(....
vArray.parray = pArray;
vArray.Detach(OutArray);
...



Thu, 21 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. COM & Thread-Safe

2. ATL COM Component firing events into VBScript event sink

3. Call VBA or COM Add-in methods from Forms events (vbscript)

4. Com vbscript and arrays

5. Passing Multi-Dimensional arrays to COM objects from VBScript/ASP

6. Handle a vbscript event inside a COM object

7. retrieving an array (SAFEARRAY) from a COM server - how to do it in VBScript

8. VBScript catching COM events

9. Passing array from COM server to VBScript client

10. Passing Arrays from VBScript to COM Object

11. returning an array of doubles from a COM object to VBScript

12. Subscribing to COM events in VBScript ?

 

 
Powered by phpBB® Forum Software