But now I want to do the reverse. Call a method with a variable number
of variants and have the called method fill them in.
I've written a method which, using VBScript, accepts a variable number of arguments, which is described in the IDL as follows :
[vararg] HRESULT Put([in] SAFEARRAY(VARIANT) aList);
But now I want to do the reverse. Call a method with a variable number of variants and have the called method fill them in.
To be clear about it :
1) I do /not/ want to return a fixed number of results.
2) I do /not/ want the method to return an array and than pick my results outof that array.
IOW, I want to be able to use :
Put(Var1,Var2,Var3, ...) '<-- This already works
and than :
Question : is what I'm after at all possible ?
I haven't seen any programming language whose function can actually
return multiple values without placing them in some kind of a container
or an interface.
But as a quick test I just tried this method :
HRESULT GetTest(out] variant* var1,[out] variant* var2);
and it works fine.
IOW, thats the second language you now know which can do it. p :-)
Functions' out arguments are just pointers to a buffer for the function
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||8 (1 / 7)|