Solved

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

Posted on 1998-08-02
11
243 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now