06-10-2009, 07:28 AM
str s.ansi(&struFind.cFileName) is OK.
int threadFind=FindFirstFileW(trueFilter,&struFind) is OK if trueFilter is BSTR, but easier to pass str or lpstr with @: int threadFind=FindFirstFileW(@trueFilter,&struFind).
Do all string manipulation with str. Convert to Unicode using @, and Unicode to str using ansi. BSTR is probably not needed in your code.
_____________
FYI: dir also uses FindFirstFileW etc. It stores find data in a special local variable _dir. Example:
dir ...
out "0x%X" _dir.fd.dwFileAttributes
int threadFind=FindFirstFileW(trueFilter,&struFind) is OK if trueFilter is BSTR, but easier to pass str or lpstr with @: int threadFind=FindFirstFileW(@trueFilter,&struFind).
Do all string manipulation with str. Convert to Unicode using @, and Unicode to str using ansi. BSTR is probably not needed in your code.
_____________
FYI: dir also uses FindFirstFileW etc. It stores find data in a special local variable _dir. Example:
dir ...
out "0x%X" _dir.fd.dwFileAttributes