Re: How to pass [IN, OUT] parameter to ActiveX control from JavaScript or VBScript
"Lei Tang" <ltang@bdmetrics.com> wrote in message
news:OeQQ$Q64IHA.5012@TK2MSFTNGP05.phx.gbl
I have an ActiveX control written in ATL and I want to use that
control from a web page. The method I want to call from JavaScript
has a [IN, OUT] parameter, i.e. BSTR GetResults([in, out] long
*count). How do I pass the "count" parameter to the method from
script?
You can't. JavaScript can't handle [in, out] parameters at all, since it
can't pass parameters by reference. VBScript only supports [in, out]
VARIANT* (and then you don't need to do anything special - VBScript
passes all parameters by reference).
If you want scripts to be able to call your interface, you will have to
design script-friendly method signatures.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925