www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - convert and assign to the BSTR char

reply new <new dummy.com> writes:
hi,

how does one convert char[] to BSTR and back? i am looking to use a dll that
contains function such as

BSTR tester = gettest(BSTR *in, BSTR in1);

any help is appreciated.
Apr 18 2009
parent John C <johnch_atms hotmail.com> writes:
new Wrote:

 hi,
 
 how does one convert char[] to BSTR and back? i am looking to use a dll that
contains function such as
 
 BSTR tester = gettest(BSTR *in, BSTR in1);
 
 any help is appreciated.
wchar* bstr = SysAllocString(std.utf.toUTF16z(s)); and char[] s = std.utf.toUTF8(bstr[0 .. SysStringLen(bstr)]); SysFreeString(bstr);
Apr 18 2009