
Passing values by reference from java / vb script to ActiveX object
It should be either [out, retval] or [in, out] VARIANT* and the passed
VARIANT contains VT_BYREF | VT_VARIANT. This is for the simple
fact that VBScript (maybe JavaScript too?) supports ONLY VARIANT
type for its variables. They are smart enough to encapsulate the
returned value, but not when you pass the VBScript variable directly.
Also, they don't support [out] only parameters.
--
===============================
Alexander Nickolov
STL Panasonic
===============================
Quote:
>Hi,
>I'm accessing my activeX object in a web page via javascript. I want to
>avoid using vbscript to keep my page available to netscape users, but I do
>experience the same problem if I use vbscript.
>Now, I want my object's methods to return values back to the script. The
>way I'm trying to do this is:
>[script] passing variables as an argument of a method:
> myobject.getID( nId );
>[activeX object] the argument is an [out]: HRESULT getID([out]int *nId);
> and gets filled in something like: *nId = 5;
>Invariably, the valud nId in the script returns from the method with the
>value 'undefined'. The same process works in VB, which leads me to believe
>it may be a problem with the variable types (no early binding!).
>Can someone explain the problem, and maybe suggest a way round it?
>Thanks for any help,
>Simon.