This worked well and compiled error free right away, just be sure to link the wininet.lib library file. I see there is an individual that posted here that needs to learn a few manners. Maybe that poster should focus a little more of those efforts to learning how to actually write code rather than raging at other when they don't understand. It takes time, years to become a good programmer. Frustration and failure are a large part of the process. So to whom ever posted "THIS DOES NOT WORK ASSHOLE!!!!" you may want to be looking into a mirror the next time you yell "Hey Asshole!!!".
I tried this code in VC6 on Win2K and it not working. WHile debugging, I observed the following behaviour. I put the watch for the following variables of LPCACHEENTRY struct.
lpszFileName is showing complete filename
lpszSourceUrlName is showing only 'h' instead of showing http://..... So, when I tried DeleteUrlCacheEntry, I am getting FILE NOT FOUND error. But when I see the memory pointed to by lpszSourceUrlName, it is showing complete URL. I couldn't figure out what is going on. Do I need to install some patch?
My observation : How it works and yet seems not to work
Posted by Legacy
on 06/03/2003 12:00am
Originally posted by:
After going through all the comments and myself experiencing the problem that the solution does not seem.
Mainly it depends where and how you have used this function.
I found out the following facts.
1. The function scans the folder and tries to delete the files.
2. The files are deleted, but if some files are locked by IE
those files will not be deleted.
3. The next time an attempt is made to delete the files again,
only if any new files in the cache will be deleted, the old
files will not be deleted ( even if they are not locked by IE)
The solution is
To maintain the physical filenames ( the filepath like c:\...\x.htm ) , perhaps in an array if the attempt to delete
the files has failed. On the next function call these files
could be deleted with DeleteFile function.
Hope this helps. Any modifications/ enhancements / corrections
That is a great thing. I didn't find any documentation for it (as you wrote) in MS site or anywhere else.
Message to NYOB - "Grow up"
Posted by JohnArmagh
on 07/17/2007 08:20am
Hopefully in the past 4 years user "NYOB" has grown up. Clearly when he posted the infantile comment he was in no fit state to reply let alone do any programming. He can't have known much about VC++, or he would have worked out the code for himself rather than using someone else's skills and effort where his own were so demonstrably deficient. What a total chump.
//Its essentially the same though :-)
// Delete all files in the Temporary Internet Files folder
// Note that you can specify what NOT to delete by testing entry type
// In code below, cookie entries are not deleted
// [see if (!(lpCacheEntry->CacheEntryType & COOKIE_CACHE_ENTRY))]
BOOL bResult = FALSE;
BOOL bDone = FALSE;
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntry = NULL;
Thanks for sharing great piece of code. I made a minor modification and have tested it specifically for deleting cookies and it not only works for Windows NT/98 but on Windows 2000 as well.
Posted by WorldNet
on 10/03/2006 12:20pm
Will it work if you have IE 5.5 and using HTML?