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)
(2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015) . . . . . . . . Hitchhiker's Guide to Getting Help at VBForums
Classic VB FAQs (updated Oct 2010) ...Database Development FAQs/Tutorials (updated May 2011)
(includes fixing common VB errors) .......... (includes fixing common DB related errors, and [Classic VB] ADO tutorial /further steps, and [VB.Net] ADO.Net Tutorial).
Tutorial: How to automate Excel from VB6 (or VB5/VBA) .•. SQL 'Select' statement formatter/checker .•. Convert colour number to colour name .•. FlexGrid: fill from recordset .•. FlexGrid: AutoSize columns .•. DB Reserved Words checker
Connection strings .•. MDAC/Jet/ACE downloads .•. SQL Server downloads .•. MZTools (free upgrade for the VB6/VBA Editor)
Click Here to Expand Forum to Full Width
Survey posted by VBForums.