Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving source code from project files?

Status
Not open for further replies.

jimbolia11

Programmer
Dec 22, 2005
2
US
I accidently overwrote the main.cpp file for my program. I had recently compiled it in both debug mode and release mode prior to this. Is there any way I can get the source code back?

I'm using Microsoft Visual Studio .NET 2003 and its a windows console c++ program.
 
Regard these as long shots.

1. The map file from a debug build will contain a lot of information on the names of variables, functions etc. From that point of view, it may provide a useful list of mental prompts to what was actually there.

2. Check the build directories for listing files. Some compiler options turn on "list" files which show mixed source and assembly code.

3. Check for backup files or files in the trash can.

4. This is extreme and time consuming. Run a disk scanner to do a text search for any sectors which contain text you can remember from your program. The longer you leave this, and the more stuff you write to the disk, the less chance this has of working.

Before you do much more work, create and test a backup procedure, or investigate a source code control system.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top