how to delete files(txt) from vc++ program
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
plz can any one help me in deleting a Text file thru c or c++ vc++ program.. ( i am using "ShellExecute(NULL, "del","c:\\res.txt",0, 0, SW_HIDE);" but this statment is not working.)
-
plz can any one help me in deleting a Text file thru c or c++ vc++ program.. ( i am using "ShellExecute(NULL, "del","c:\\res.txt",0, 0, SW_HIDE);" but this statment is not working.)
1.Windows API
BOOL DeleteFile( LPCTSTR lpFileName // pointer to name of file to delete );
2. MFC methodstatic void PASCAL Remove( LPCTSTR lpszFileName ); throw( CFileException );
3. Windows Shell APISHFileOperation()
I'd prefer the first way, but the 3rd way is powerful