bool FileExists(LPCTSTR lpszFileName, bool bIsDirCheck)
{
DWORD dwAttributes = GetFileAttributes(lpszFileName);
if(dwAttributes == 0xFFFFFFFF)
{
return false;
}
if((dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
{
return bIsDirCheck;
}
else
{
return !bIsDirCheck;
}
}