cpp file not opening correctly.

Nov 2, 2014 at 6:17pm
When I try to open the cpp source in Visual Studio, it just opens a blank notepad window. The cpp file says its 4 kb and there was code in it. Has anyone had this happen before and is there a way I can fix this or is the code lost forever?
Nov 2, 2014 at 7:23pm
locate the file in windows explorer, right-click and select 'edit'. what happens then?
Nov 2, 2014 at 8:41pm
It opens an empty text file. I know I saved it but while it was still opened on my computer, I just held the power button to turn my computer off. Could that have messed it up? I've done it a few times before though and had no problem.
Nov 2, 2014 at 9:03pm
The OS usually buffers file data so it might not be written to the hard drive until a few seconds later. This is normally nothing you will ever notice because the OS hides it well, but if you turn off the computer without the OS having any chance to shut down normally then data could be lost.
Last edited on Nov 2, 2014 at 9:08pm
Nov 2, 2014 at 9:28pm
The same thing happened to me too, 6-7 months ago. Lost the entire project.
Nov 2, 2014 at 9:30pm
I guess it's back to square one then.
Topic archived. No new replies allowed.