We have an correspondence application developed in VC++ and using mail merge technology which sends emails to the customers in word documents. Here is my code which is used to delete the temp files once the email is sent , but the "retD returns 0", which means it failed to delete the file and the file is still haging in the temp folder.
I used the GetLastError() function and it returns 2, which means "File Not found Error"
but I put check "fileN" , it does shows the exact path and the document name which need to be deleted.
Can you one point me in right direction as to how to delete the file?
// delete temporary files
for ( i = 0; i < mergedFiles.GetSize(); i++ )
CString fileN = mergedFiles[i];
//retD = DeleteFile (mergedFiles[i]);
retD = DeleteFile(fileN);
mergedFiles is an CStringArray