Access violation when using IShellFolder2
FreeSlave
freeslave93 at gmail.com
Thu Sep 10 17:55:16 UTC 2020
On Thursday, 10 September 2020 at 15:20:54 UTC, John Chapman
wrote:
> 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);
Thank you again for consulting. I thought these character are
part of the date format. This is all working now.
More information about the Digitalmars-d-learn
mailing list