Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

pass SAFEARRAY of BSTR from C++ to C# DLL

$
0
0

My code is soemthing like

BSTR vb[20]; //heap alloc or _bstr_t no help

SAFEARRAY* sa = SafeArrayCreateVector(VT_BSTR, 0, 20);

long m =0;

SafeArrayPutElement(sa, &m, vb);

_exten_obj->GetData(sa); //C# DLL void GetData(string[]) in which correctly populates the string[]

//vb contains unrecognized texts; regardless of char set to unset, UNICODE or MBCS

SafeArrayGetElement(sa, &m, (void*)vb); //did not help

Any idea?


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>