How do I create a variant array of BSTR in Euphoria using EuCOM?

euphoria , vb6 , eucom , variant , safearray , typelib Perth, Australia
  • 12 years ago
    So far I've figured out how to pass Unicode strings, BSTRs, to and from a Euphoria DLL 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? Anyone?
  • 12 years ago
    Hi Bruce, I won't claim to be an expert on this by any means... it's been a long while since I was doing that sort of stuff with VB 6! Could you post the corresponding code for how you're successfully passing the single BSTR parameter? It's a long shot but may help for me to spot what might be going wrong!

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”