Connecting Tech Pros Worldwide Forums | Help | Site Map

IE cache class problem

Member
 
Join Date: Sep 2008
Posts: 74
#1: Oct 17 '08
Hello,

http://support.microsoft.com/kb/311289

I am using code from the above page to clear IE cache files

it does the job when i click the first time on the button

but after clicking it the second time it just hangs and stops responding :(

I see that the error hangs the app on this line :
Expand|Select|Wrap|Line Numbers
  1. returnValue = ieCacheClass.DeleteUrlCacheEntry(internetCacheEntry.lpszSourceUrlName)
i would really appreciate some one could help me solve this issue

[i'm using VB2005 + VB.net]

Regards,
Zubair

kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Oct 17 '08

re: IE cache class problem


How far apart are the clicks? Do you need to disable the button when first called and enable once the deletion has finished?
Member
 
Join Date: Sep 2008
Posts: 74
#3: Oct 17 '08

re: IE cache class problem


Hello

I'm extremely sorry but i dont understand what you mean? :(

The URL i posted above takes to a page on microsoft site which contains a class and module that i am using to clear the Temporary Internet Files

I make a call to this when the button is clicked, when i click that button the first time it clears the cache as it should - But when i click on the button again after clicking once.. Then it stops responding and i have no choice but to terminate the program by force.

I can't figure out what the problem is - it stops responding after i call the function the 2nd time :o but i tried one more thing...

I clicked the button to call the function so that it clears the cache - it does that.
but now i dont click on the button again.. instead i opened up my internet explorer visit another website (www.example.com). now when i check the cache folder it has some cache files again- (please note my app is still running)- because i just browsed to a page again. now after checking i click the button to clear the cache on my app once again, This time the app doesn't stop or hangs - it deletes it as its suppose to. Now i think the problem i am having is because the code couldn't find any more cache files.

But i can't figure out on how i could resolve this issue :(
again in my VB 2005 - it stops responding from this line:
Expand|Select|Wrap|Line Numbers
  1. returnValue = ieCacheClass.DeleteUrlCacheEntry(internetCacheEntr  y.lpszSourceUrlName)
please note the above code is also visible on the URL i post on my 1st post.

I would really really appreciate if some one could help me resolve this issue :(

Thank you!
Kind Regards
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,130
#4: Oct 17 '08

re: IE cache class problem


Kenobewan was implying that you may be clicking the button too quickly....it may be still processing the first delete cache command when you execute the second call....this may be the reason it crashes.

He suggested disabling the button until your cache is cleared to make sure that this is not happening.
Member
 
Join Date: Sep 2008
Posts: 74
#5: Oct 17 '08

re: IE cache class problem


Quote:

Originally Posted by Frinavale

Kenobewan was implying that you may be clicking the button too quickly....it may be still processing the first delete cache command when you execute the second call....this may be the reason it crashes.

He suggested disabling the button until your cache is cleared to make sure that this is not happening.

Thanks Frinavale for clearing it up for me :)

but unfortunetly thats not the case :(

I'm not clicking the button to early - i let the app delete everything and then try again - i have even waited over 15 mins just to make sure now :(

There is something wrong with that code on MICROSOFT website i guess :( but dont know how to resolve that :(
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#6: Oct 18 '08

re: IE cache class problem


Quote:

Originally Posted by zubair1

I'm not clicking the button to early - i let the app delete everything and then try again - i have even waited over 15 mins just to make sure now :(

There is something wrong with that code on MICROSOFT website i guess :( but dont know how to resolve that :(

That's one possibility. Another more likely is that you are not using it correctly.

What you need to now is initiate your debugging procedure. Then if you are still stuck tell us any errors that you are receiving. Insert break points if the code is just hanging to ensure that the code runs ok up until that point. Other things you might try are try/ catch blocks, timeouts and throwing exception.
Member
 
Join Date: Sep 2008
Posts: 74
#7: Oct 18 '08

re: IE cache class problem


Hi Keno

Thanks for your response

I tried everything -

i dont know any extra ordinary ways of debugging a program - i'm quite new to vb.net - just learning my way through it all.

The one thing i notice is that it stops the app on this line Keno
Expand|Select|Wrap|Line Numbers
  1. returnValue = ieCacheClass.DeleteUrlCacheEntry(internetCacheEntr  y.lpszSourceUrlName) 
I'm positive - theres nothing wrong in my code.

If you open up the link to code i posted above from microsoft website - and if you copy / paste the code as is instructed on the site it still does the same thing (have you tried that?).

I opened vb 2005 and made a new win app file
and followed all the instructions as directed on the microsoft website but the end results are the same - it works the first time but the second time it runs it just hangs / stops responding.

I'm pretty sure its something in that code provided by microsoft but not sure what exactly might the cause be :(

can anybody try that code on microsoft and see if it works for them plz ? :(

by the way i'm not sure if this matters but i'm using IE 7.
Reply