Hi all,
I've developed an OCX with a public function taking 3 refences parameters and returning one Variant:
ret = f(p1,p2,p3).
My problem here is that f reports in VBA that the parameter type is invalid as soon as more than 1 parameter is declared as reference or [in,out]. Hover the same OCX and function works in:
C++
VB.NET (VS2008,VS2010)
C#
but not in VBA??
*** Declarations ****
IDL file:
void f([in,out] BSTR* bstrTitle, [in,out] BSTR* bstrParameter1,[in,out] BSTR* bstrParameter2, [out,retval] VARIANT* varReadDataReturn);
CPP file:
DISP_FUNCTION_ID(xxx, "f", DISPID_f,
f, VT_VARIANT,VTS_PBSTR VTS_PBSTR VTS_PBSTR VTS_VARIANT
VARIANT class::f(CComBSTR& bstrTitle, CComBSTR& bstrParameter1,CComBSTR& bstrParameter2,VARIANT* varReadNumericDataReturn)
Has anyone an idea why it does not work in VBA?
Thanks