Saving MFC Source :: C++

kuphryn

Senior member
Jan 7, 2001
400
0
0
Hi.

I started an MFC sample program that Prosise include in his book. I would like to save the source code, but not the enter project. Note that I started the project using AppWizard.

What files do I have to save from the project so I can always open that project up again? Do I have to save the entire probject including Debug? I have not save and/or remove any files yet because I do not work to lose any resource files.

Thanks,
Kuphryn
 

Palek

Senior member
Jun 20, 2001
937
0
0
Okay, the files that you definitely do NOT need are:

<projectname>.aps
<projectname>.clw
<projectname>.ncb
<projectname>.opt
<projectname>.plg

and everything inside the Debug and/or Release folders. You can go ahead and delete all of these. This will cut the size of your project way down. You should keep all the other files.

Also, certain functions, such as the popup list of methods and members for a certain class that comes up when you type in the name of an instance, will stop functioning every now and then for no reason - some stupid bug in Visual Studio, I guess. Deleting the above files usually helps resolve this issue. One thing, though, the .clw file contains the class information for ClassWizard, so if you erase it, the next time you try to use ClassWizard, VS will tell you that it cannot locate the class info. No need to worry though, because it will also offer to retrieve all class info for you, you just click Yes, then OK.

<Edited for clarification>
 

spwango

Senior member
Mar 7, 2001
419
0
0
Why wouldn't you save the entire app? If you do a "clean" in both debug and release, the other files that you don't need aren't that much bigger to not save them. If it's just code from Prosise's book (great choice BTW), without the build stuff, it's only going to be a few K anyway.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
For backing up manually I use WinZip set to save paths but not recurse subfolders. I (add with wildcards) the main folder and "Res" folder, then sort by size which brings the ".aps" and ".ncb" files to the top for easy deletion. The others Palek mentions are small enough I don't usually bother with them.

If you name the zip something like "appname mm-dd-yy" it's easy to keep a folder of these and restore a source file if you accidentally lose or damage some code.
 

kuphryn

Senior member
Jan 7, 2001
400
0
0
Thanks.

I have an idea for Microsoft. Microsoft should design a feature that can compress all *required* files into a zip/rar. Visual C++ exclude all temporary files. The programmers will only need to unzip it.

Kuphryn
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126


<< I have an idea for Microsoft. Microsoft should design a feature that can compress all *required* files into a zip/rar. Visual C++ exclude all temporary files. >>


That's a good idea for solo developers, I'd use it daily for some projects. They're most focused on corporate development though, where you'd use Visaul SourceSafe to manage files.

I keep meaning to look at the WinZip command-line addon to see about setting up a batch file for backups, but never seem to get around to it.