- int len = SysStringLen(bStr) + 1;
- char *buf = new char[len];
- (void)wcstombs( buf, bStr, len);
- wxString str(buf);
- delete[] buf;
+ wxString str;
+ if ( !::WideCharToMultiByte(CP_ACP, 0 /* no flags */,
+ bStr, len /* not necessary NUL-terminated */,
+ wxStringBuffer(str, len + 1), len + 1,
+ NULL, NULL /* no default char */) )
+ {
+ str.clear();
+ }