Use char in FindFirstFile() and FindNextFile() ?

Previous I use wchar_t because I'm using FindFirstFile() and FindNextFile() for searching all the files under the given data folder SStress_Corpus. Their MSDN pages are:

http://msdn.microsoft.com/en-us/library/aa364418(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/aa364418(v=vs.85).aspx

As their descriptions said, their parameter 1 should be the type of LPCTSTR, that is wchar_t.

HANDLE WINAPI FindFirstFile(
__in LPCTSTR lpFileName,
__out LPWIN32_FIND_DATA lpFindFileData
);

BOOL WINAPI FindNextFile(
__in HANDLE hFindFile,
__out LPWIN32_FIND_DATA lpFindFileData
);


But I want to avoid using wchar_t type because it's so inconvenient when elsewhere I use char. So I want to use char in all places.

Then how can I use the type of char instead of wchar_t in the function FindFirstFile() and FindNextFile()?
Goto project properties->Configuration Properties->General, select Character Set. Change "Use Unicode Character Set" to "Use Multi-Byte Character Set" or "Not Set". Then you can use char for FindFirstFile. Otherwise directly use FindFirstFileA() and FindNextFileA to use ANSI version of those functions.

Good Luck.
Topic archived. No new replies allowed.