Solved

Changing the name of a Visual C++ project or workspace

Posted on 1998-08-02
11
279 Views
Last Modified: 2013-11-19
How does one change the name of a Visual C++ project such that it creates an EXE with a different name, shows a different name in its resouces, etc?

RJV
0
Comment
Question by:RJV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 8

Accepted Solution

by:
trestan earned 100 total points
ID: 1320108
You can change the cpp file name containing the "main" (the App in Windows application) and recompile it. the project name will be changed. And you have to include other files into the new project.
0
 
LVL 8

Expert Comment

by:trestan
ID: 1320109
Another way is to make changes in .dsp file, but I do not think it will be an easier work than the previous methods. You have to make the changes to filenames in either way.
Nice day.
0
 

Author Comment

by:RJV
ID: 1320110
Trestan,

What do you mean by include other files? Namely, what happens to the CLW file, for example? How is the main file located when it is linked, not to mention it's header file when included in other cpp files?

RJV

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:trestan
ID: 1320111
I mean there are more than one files in your project. You can either change their names in .dsp file to their new names or by compiling the principle file (at this time, one this file is existed in the project, so you need to add others manuelly.) I do not think you need to change CLW file.
0
 
LVL 8

Expert Comment

by:trestan
ID: 1320112
Since you mainly want to change the .exe name, so just change the "main" filename is enough. The less change you made, the less trouble in compiling. Otherwise you have to modify the CLW manually. However, I suggest you make as much less as possible.
0
 

Author Comment

by:RJV
ID: 1320113
Trestan,

Your explanation is very unclear. I have a working project, with several files and classes. Simply renaming the main CPP file means that the classes continue with the same name, for example. That is, unless I rename those, which will impact the rest of the project. This not to mention the header file's name and references to it. What I want to do is to use most of that project in another, including the resources, eliminating about 30% of the original.

I'd appreciate your giving clearer explanations, particularly as the change should affect more than you are indicating.

RJV

0
 
LVL 8

Expert Comment

by:trestan
ID: 1320114
Since in your original question you want to change the .exe file name, so I do not think you need to change the class name. For example, if you create a project named MyProj, then there will be a file named MyProj.cpp. The executable will be MyProj.exe. If you want another exe name, just change MyProj.cpp to MyNewProj.cpp, do as I said, then you will have MyNewProj.exe. But I guess you want make more changes to your project. So I think you must make clear what your goat is. I guess you want to make some changes to the class name, right? If so, you have to make all changes related with this class name and the file containing this class. However, I really think I have made clear illustration but maybe your question related to wider range than I supposed to be. Pls give me more clues about what you want. thx
0
 

Author Comment

by:RJV
ID: 1320115
Trestan,

Your explanation is very unclear. I have a working project, with several files and classes. Simply renaming the main CPP file means that the classes continue with the same name, for example. That is, unless I rename those, which will impact the rest of the project. This not to mention the header file's name and references to it. What I want to do is to use most of that project in another, including the resources, eliminating about 30% of the original.

I'd appreciate your giving clearer explanations, particularly as the change should affect more than you are indicating.

RJV

0
 

Author Comment

by:RJV
ID: 1320116
So far, not so simple. I copied the whole project to another subdirectory (as the original will still exist) and renamed MyProj.cpp to MyNewProj.cpp. The result is that I get a link error as the compiler/linker tries to get variables that are in the original directory/folder/subdirectory.

I'd like to get this to work first and foremost. However, I would like to have CMyProjectDoc and CMyProjectView named as CMyNewProjectDoc and CMyProjectNew, repectively. This not to mention CMyProjectApp renamed to CMyNewProjectApp. This would make things a bit clearer.

Overall, so far not an easy job. As you've been down this rode before, let me know where the holes are and how to avoid them.

RJV

0
 
LVL 8

Expert Comment

by:trestan
ID: 1320117
At first, change the .exe name. The simplest way: modify the output file name in the Link tab of the project setting, recompile the project. Then you get the new exe file. The second: Export a mak file under the Project menu commend. Make changes in this file and open this file instead of .dsw .
There will be a lot of trouble if you want to change the names of the classes. One seemed to be stupid but works way is to recreate a App under new name, the wizard will create all the corresponding class for you, then you copy your codes from the old one. The second way is to change the class name manually. I suggest you make change to one class each time and make sure make changes everywhere. (Use find in Files to find all the old name). The CLW will ask you to modify the class name. Or you delete the CLW file, after you make all the changes you want, recreate by compiling the project. Ok, tell me if you met any further trouble. Good luck.
0
 

Author Comment

by:RJV
ID: 1320118
I tried essentially all of the recommendations you made except for the EXE alternative. However, I had another possibility and as time is essential, I went along that route. Basically, creating the project from scratch and making changes to it to reflect the original. It is now compiled, done, working and ready for the changes to make it fully operational.

Thanks for the input in the meantime.

RJV

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question