I have created a project in Visual C++ 6.0 called qcard4. This project was started by creating a new single document project and copying and pasting code from qcard3 into the files. I have been gradually improving and modifing this code from qcard1. I tried to produce the qcard3 code by just making it dependant on qcard2. I don't know why but I lost the ability to use or recompile the qcard2 project when I did this. I didn't want that to happen, it just did. Now I have all the files for qcard2 but I can't modify it. It's useless to me as stand alone code.

All these projects have a different purpose but require similar code in a lot of respects. Once I get them working I like to leave them alone.

In c and c++ this was not a problem. All I had to do was copy the source into a different folder (directory) and rename it. then I could do anything I wanted to it without effecting the allready working program.

So far in Visual c++ I have been unable to do this. I have looked for a way to rename a project but apparently there is no way to do this. I would like to have separate project folders for each version so that once they are working (debugged) I can leave them alone. I can copy the whole folder and rename it, but the individual files still carry the old project name.

I would like to create a project called qcard5 (in a seperate folder) starting with the qcard 4 source code, but I don't want to lose what I allready have working in the qcard4 software. This project will perform totally different screen graphics displays by using modified qcard4 code. What is my best approach for doing this?

Recommended Answers

All 6 Replies

1. start a new empty project and call it qcard5.

2. Copy the *.cpp and *.h files from qcard4 into qcard5 directory

3. select menu Project --> Add To Project --> Files and select the files you want to add to the project.

Mission accomplished.

1. start a new empty project and call it qcard5.

2. Copy the *.cpp and *.h files from qcard4 into qcard5 directory

3. select menu Project --> Add To Project --> Files and select the files you want to add to the project.

Mission accomplished.

Please understand that I am not trying to be funny here.
I tried to create an "empty project" but the selections the project wizard gave me did not include this phrase. It was also not available in the help index or the help search. Both empty and project were in the index but not together. The only thing I could create with the project wizard was far from empty as I need an SDI. Please be more specific about what you mean by "empty project"

File --> New --> Win32 Console Application --> Wizzard displays a dialog with 4 radio buttons, the first one is An empty project.

I have VC++ 6.0 Pro edition. I don't know if other editions (such as standard edition) have that menu item or not. If not, then just create a console application, delete all the *.cpp and *.h files, then copy from old to new project.

If you want an MFC project, then its a little more complicated, but basically the same. Create a new mfc project and copy files from old to new project, replacing any files that the new project contains that have the same filename. you may have to rename some of the files after copying.

File --> New --> Win32 Console Application --> Wizzard displays a dialog with 4 radio buttons, the first one is An empty project.

I have VC++ 6.0 Pro edition. I don't know if other editions (such as standard edition) have that menu item or not. If not, then just create a console application, delete all the *.cpp and *.h files, then copy from old to new project.

If you want an MFC project, then its a little more complicated, but basically the same. Create a new mfc project and copy files from old to new project, replacing any files that the new project contains that have the same filename. you may have to rename some of the files after copying.

I have tried this approach after finding the empty project in the win console application. I generated 18 link errors of which 16 have been resolved by 1-selecting use mfc as a shared dll and 2-adding my dll library file name, both in the link options.
The remaining link errors appear to be a single problem of which there are about 20 different solution possibilities. I'm working on this but any quick solution ideas would be appreciated.

[compiler output]
Deleting intermediate files and output files for project 'Qcard5 - Win32 Debug'.
--------------------Configuration: Qcard5 - Win32 Debug--------------------
Compiling resources...
Compiling...
NewGame.cpp
Qcard4.cpp
Qcard4Doc.cpp
Qcard4View.cpp
shuffle2.cpp
StdAfx.cpp
MainFrm.cpp
Linking...
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/Qcard5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Qcard5.exe - 2 error(s), 0 warning(s)
[/compiler output]

A Win32 Console Application expects main to be defined somewhere.

since you have MainFrm.cpp I appears that the original program was MFC. You don't want to create a win32 Console application for that, but create an MFC application just like you did the original program, but give it the new program name. After that you should be able to delete all files from the project, copy the files from the old project directory into the new directory, then add the files you copied into the new project -- menu Project --> Add To Project --> Files.

You will probably want to keep the <project name>.cpp and <project name>.h files that the wizard created for the new project.

Here is a utility program that is supposed to rename the project. I have never used it so use it at your own risk. You will want to read the comments at the end of the article.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.