This static function deletes the file specified by the path.
static void PASCAL Remove(
A string that is the path to the desired file. The path can be relative or absolute, and can contain a network name.
It will not remove a directory.
The Remove member function throws an exception if the connected file is open or if the file cannot be removed. This is equivalent to the DEL command.
//example for CFile::Remove
TCHAR* pFileName = _T("Remove_File.dat");
catch (CFileException* pEx)
TRACE(_T("File %20s cannot be removed\n"), pFileName);