Non-MFC Equivalent to CFileFind?
-
I need the functionality of CFileFind for a project, but I can't be dependent on MFC for this project. Is there an API equivalent, or better a portable library for doing this? I know Boost has a class dir_it that will do it, but it looks like its still in beta.
-
I need the functionality of CFileFind for a project, but I can't be dependent on MFC for this project. Is there an API equivalent, or better a portable library for doing this? I know Boost has a class dir_it that will do it, but it looks like its still in beta.
CFileFind
is based on a Win32 API. To do it w/out MFC, use something like this:WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(strCurrentPath + m_szREPORT_FILTER, &FindFileData);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
// do stuff with FindFileData.cFileName
} while ( FindNextFile( hFind, &FindFileData) );
FindClose(hFind);
}--------
Life is fraught with opportunities to keep your mouth shut.
--Shog9 --
-
I need the functionality of CFileFind for a project, but I can't be dependent on MFC for this project. Is there an API equivalent, or better a portable library for doing this? I know Boost has a class dir_it that will do it, but it looks like its still in beta.
You could also use
_findfirst()
,_findnext()
and_findclose()
. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com -
I need the functionality of CFileFind for a project, but I can't be dependent on MFC for this project. Is there an API equivalent, or better a portable library for doing this? I know Boost has a class dir_it that will do it, but it looks like its still in beta.
CFileFind is supported by ATL so a pure Win32 API project should support CFileFind.
- Michael Haephrati מיכאל האפרתי