EuCOM and VARIANT arrays of BSTR
- Posted by axtens Oct 16, 2008
- 996 views
G'day everyone,
I've figured out how to pass BSTRs to and from a Euphoria DLL from VB6 using a Typelib. What I can't figure out, thus far, is how to create and pass back an array of BSTRs.
The code I have thus far (along with includes for EuCOM itself and parts of Win32lib):
global function REALARR() sequence seq atom psa atom var seq = { "cat","cow","wolverine" } psa = create_safearray( seq, VT_BSTR ) make_variant( var, VT_ARRAY + VT_BSTR, psa ) return var end function
Part of the typelib is:
[ helpstring("get an array of strings"), entry("REALARR") ] void __stdcall REALARR( [out,retval] VARIANT* res );
And the test code, in VB6 is:
... Dim v() as String V = REALARR() ...
So far all I've managed to get is an error '0' from the DLL. Any ideas?
Kind regards, Bruce.