Originally Posted by _Stefan This probably works: It is my understanding that this will not work as the first 4 bytes of a BSTR contain the length of the string, so you would have to compensate for this. Maybe QString convertedBSTR((QChar*) &bstr[4], wcslen(bstr)); ?
http://www.codeproject.com/kb/string/bstrsproject1.aspx
Try: std::wstring intermediateString(myBSTR, SysStringLen(myBSTR); QString finalString = QString::fromStdWString(intermediateString); -K
bmn (16th February 2012)
No need to use std: QString qstr((QChar*)bstr, ::SysStringLen(bstr));
Forum Rules
Bookmarks