Re: What is wrong with this method invocation?
Giovanni Dicanio <giovanni.dicanio@invalid.it> wrote:
"Igor Tandetnik" <itandetnik@mvps.org> ha scritto nel messaggio
news:OsTgvxVIIHA.4196@TK2MSFTNGP04.phx.gbl...
VBScript only supports VARIANT* for [in, out] parameters [...]
Unlike VB, which can handle any automation type.
So, as a summary, is the following correct?
1. With Visual Basic 6 and VBA:
we can use any automation type, both as [in] and as [in, out]
parameters; we can use any automation type also as [out, retval]
parameter.
2. With VBScript:
we can use any automation type as [in] parameters and [out, retval]
parameter; we must use VARIANT* for [in, out] parameters.
Correct. For completeness, JavaScript doesn't support [in, out] or [out]
parameters at all ([out, retval] works for any type).
If this summary is correct, is any technical reason for this
limitation of VBScript?
From the horse's mouth:
http://blogs.msdn.com/ericlippert/archive/2003/09/29/53117.aspx
IMHO, I think that we should use VARIANT as less as possible, because
this prevents IntelliSense. Is this correct?
There's no IntelliSense for VBScript, as far as I can tell. VBScript
does not read type libraries and does not know method signatures at
design time (nor really at run time - it just throws the values over to
IDispatch::Invoke and hopes for the best).
--
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