Click to See Complete Forum and Search --> : Passing SAFEARRAY from VC++ to VBScript


ofer_bz
April 30th, 2001, 06:42 AM
Hi,

I am writing a component in VC++ for VBScript. I want to write a function that returns an a SAFEARRAY. How can I do that ? What should I write in the IDL file ?

Thanks,

Ofer

ddpanda
November 19th, 2001, 11:34 PM
As far as I am concerned,it is impossible!Because
VBScript can't pass parameter by reference

Green_Beret
November 20th, 2001, 12:07 AM
IDL file definition :

GetData([in,out]SAFEARRAY(BSTR) *psa,[out,retval]long *p_retval);





Implementation :

GetData(SAFEARRAY **psa,long *p_retval)
{

.....


}





In VBscript :

Dim strArray(0 to n) as string
Dim retval as Long

retval = comObj.GetData(strArray);






Regards,
The Beret.