Access violation when using IShellFolder2

John Chapman johnch_atms at
Thu Sep 10 15:20:54 UTC 2020

On Thursday, 10 September 2020 at 13:30:15 UTC, FreeSlave wrote:
> Thanks. I tried this, but VarDateFromStr does not succeed for 
> me.

It turns out the shell embeds some control characters in the 
string, specifically 8206 and 8207. So remove those before 
passing it to VarDateFromStr.

auto temp = strRet.pOleStr[0 .. lstrlenW(strRet.pOleStr)]
   .replace(cast(wchar)8206, "")
   .replace(cast(wchar)8207, "");
DATE date;
VarDateFromStr((temp ~ '\0').ptr, LOCALE_USER_DEFAULT, 0, &date);

More information about the Digitalmars-d-learn mailing list