When my program reads index.dat of the internet cache it crashes, but it reads a copy of the file just fine. How come simple apps like notepad can read it but my prog can't?
When my program reads index.dat of the internet cache it crashes, but it reads a copy of the file just fine. How come simple apps like notepad can read it but my prog can't?
Why would your program crash? Are you being an idiot and not checking if the file actually opened before you try to mess with it?
Those "simple apps" are opening the file in a shared mode I believe, unlike what you're probably doing.
You where right & wrong, I was checking, but the wrong way. After running through my code again, I changed if(!hFile) to if(hFile==INVALID_HANDLE_VALUE).Why would your program crash? Are you being an idiot and not checking if the file actually opened before you try to mess with it?
What is shared mode? ...why are 'simple apps' in quotes?Those "simple apps" are opening the file in a shared mode I believe, unlike what you're probably doing.
EDIT: Nevermind, I got it.
EDIT: Nope, opening the file in shared mode doesn't work either, what's wrong here??
Last edited by Queatrix; 07-23-2007 at 08:21 PM.
Is GetLastError() applicable in this case? If so, what is it returning?
Yep, I was afraid of that, it's a sharing violation (32)... but still, how can other apps do it?
Ah ha.
Thanks for the help, but I got it. This guy had the same problem, and got it fixed.