‘Invalid File Handle’ error in Delphi 2010

I have been using Delphi 2010 as my IDE program for a long time, but in the past few days, it has been giving me the Invalid File Handle system error (error $C0000008) whenever I try to create a TFile. In an attempt to determine the problem, I decided to create the test snippet TFileStream.Create (c:temptestfile.tmp), which is no better than a button handler. Although I was able to create the file, the test snippet returned the same error, even if I possessed all the rights to the folder. However, if I run the file outside IDE, or if the integral debug is turned off, the codes work just fine. I haven’t altered any of the settings in Delphi and in my Vista 32-bit operating system (OS). Can anyone help me get through this problem? I do not want to go through the pain of reinstalling the program until I exhaust all available options. Thank you very much to those who will be helping me.
