Re: can not delete a file
As the error suggests: Do you have enough privilegues to delete the file/s?
Re: can not delete a file
Sure NoHero,
Quote:
Originally Posted by NoHero
As the error suggests: Do you have enough privilegues to delete the file/s?
I have the privilege. I am admin and I can manually delete such files. I think there should be something wrong with my program, but through debugging for almost an hour, I still can not find the reason. Any ideas?
regards,
George
Re: can not delete a file
Code:
// delete 1st file
rtn = DeleteFile(&(FindFileData.cFileName));
You are already passing a pointer to the first element of an array to DeleteFile. No reason to take the pointer to the pointer... ;)
Try:
Code:
rtn = DeleteFile(FindFileData.cFileName);
Re: can not delete a file
Adding to NoHero, Are you sure that your application has no open handles to those files ?
Re: can not delete a file
You are right, NoHero!
Quote:
Originally Posted by NoHero
Code:
// delete 1st file
rtn = DeleteFile(&(FindFileData.cFileName));
You are already passing a pointer to the first element of an array to DeleteFile. No reason to take the pointer to the pointer... ;)
Try:
Code:
rtn = DeleteFile(FindFileData.cFileName);
regards,
George
Re: can not delete a file
Thanks Krishnaa, no other applications have any handles to the files.
Quote:
Originally Posted by Krishnaa
Adding to NoHero, Are you sure that your application has no open handles to those files ?
regards,
George
Re: can not delete a file
Quote:
Originally Posted by George2
You are right, NoHero!
You are welcome ;)
But I have to admit, my eyes are getting sloppy :D
Re: can not delete a file
Just aside note, it better using ::SHFileOperation() since DeleteFile() will fail in deleting read only files.
Cheers
Re: can not delete a file
Thanks golanshahar,
Quote:
Originally Posted by golanshahar
Just aside note, it better using
::SHFileOperation() since DeleteFile() will fail in deleting read only files.
Cheers
SHFileOperation can not be used for Windows CE platform.
regards,
George