Aug 17th, 2013, 09:14 AM
It works! But
BSTR tmp = SysAllocString(L"Hello world");
Does not compile. Any hint?
char mystr = "Hello world";
BSTR tmp = SysAllocString(mystr);
Aug 17th, 2013, 09:54 AM
[SOLVED] Re: SysAllocString
Finally, I solved as follows:
string str="Hello World";
int wslen = ::MultiByteToWideChar(CP_ACP, 0 /* no flags */,
BSTR wsdata = ::SysAllocStringLen(NULL, wslen);
::MultiByteToWideChar(CP_ACP, 0 /* no flags */,
BSTR tmp = SysAllocString(wsdata);
Aug 18th, 2013, 06:54 AM
Re: [SOLVED] Re: SysAllocString
Thread moved from the 'VB6 and Earlier' forum to the 'C and C++' forum
As you now have it sorted out, could you please do us a little favour, and mark the thread as Resolved?
Originally Posted by cristinuccia
(this saves time reading for those of us who like to answer questions, and also helps those who search to find answers)
Click Here to Expand Forum to Full Width
Survey posted by VBForums.