JJ,
That should be defined as:
HRESULT GetData([in, out] float* val1,[in, out] float* val2,[in, out]
float* val3);
When I tried that (and just now re-tried to make sure) it gave me the same "type mismatch" error (not even trying to execute the OCX methods code)
Otherwise, the function will get the pointer to the copy of the
given values.
First, the VBScript doesn't even get that far. It rejects the call itself.
Second, why the copy ? As far as I can tell the translation layer
/should/ be able to just point into the provided variant, setting its type
to the one specified in the IDL description and just let the OCX code write, thru the pointer, whatever it wants into it.
And as I mentioned in my remark section, changing the type from"float*" to "variant*" suddenly gets everything to work, even though I have just "[out]" and not "[in, out]"
IOW, this works:
HRESULT GetData([out] variant* val1,[out] variant* val2,[out] variant*
val3);
but this doesn't.
HRESULT GetData([out] float* val1,[out] float* val2,[out] float* val3);
and I do not see any reason why.
.... :-(
I just noticed in my initial post that I in the "GetData" definition used "[in]" where I should (ofcourse) have said "[out]" - I copy-pasted the (anonimized) "SetData" definition and changed its name but forgot to do the same with its direction. :-|
My apologies.
IDL example for a method which uses its multiple arguments as output is
the IWebBrowserApp::ClientToWindow, which is defined in SHDOCVW.DLL's
type library.
This is the IDLs information of the the first argument of that IWebBrowserApp::ClientToWindow method:
TypeDesc : 001A - PTR 00000000 0016 - INT
ParamDesc : 0003 - IN OUT
This is the first argument of my GetData method (using your in, out)
TypeDesc : 001A - PTR 00000000 0004 - R4 (Float)
ParamDesc : 0003 - IN OUT
The only difference seems to be Int versus Float
I rewrote my GetData definition to exactly mimic the ClientToWindow one
TypeDesc : 001A - PTR 00000000 0016 - INT
ParamDesc : 0003 - IN OUT
, but it still fails. I would like to have been able to test that ClientToWindow, but I have no idea how/where to use it. Do you happen to
know of some certain-to-work bit of VB script ?
... Currently I'm starting to get the feeling that VBScript refuses any "by reference" argument type, but for a variant (and possibly a BStr. Haven't tested that one yet).
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)