Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// in header
CString resultsDir;
CString FileIO::FindFile ( LPCTSTR baseDirectory, CString file )
{
CFileFind finder;
resultsDir = "none"; // used to check if file has not been found.
// build a string with wildcards
CString strWildcard( baseDirectory );
strWildcard += _T( "\\*.*" );
// start working for files
BOOL bWorking = finder.FindFile( strWildcard );
while (bWorking)
{
bWorking = finder.FindNextFile();
// skip . and .. files; otherwise, we'd recursively search infinitely!
if ( finder.IsDots() ) continue;
CString str = finder.GetFilePath();
// if change dir name so has first run no in it - we can change the search criteria
// if it's a directory, recursively search it
if ( finder.IsDirectory() )
{
if ( FindFile( str, file ) != "none" ) bWorking = false; // if FindFile != "none" -> file has been found - so exit
}
else
{
if ( finder.GetFileName() == file )
{
bWorking = false;
resultsDir = finder.GetFilePath();
}
}
}
finder.Close();
return ( resultsDir );
}