Solved

Renaming a Project

Posted on 1998-09-24
4
435 Views
Last Modified: 2013-11-19
Does anyone know a relatively simple way to change the name of a project?

I have created a basic project with some functionality and now I want to make several copies and give them different names, this would include the class names, file names etc. Basically I want to change the "Base" name for the project. I can then customize each the way I want.
0
Comment
Question by:gbentley
4 Comments
 
LVL 3

Expert Comment

by:plaroche
ID: 1322547
There is no "magic" way, the name of your project is located in your DSW and DSP files, which you will also want to rename.  Renaming those files will force you to rename any other generated files if you want to keep them, otherwise you can delete them.

IE:  project.dsp renamed to p.dsp

     project.clw renamed to p.clw
     project.ncb rename to p.ncb
     etc....
0
 
LVL 5

Author Comment

by:gbentley
ID: 1322548
Can you give me a little more detail on what files need the changes and what to look out for as regards references to the changed file names.

As well you don't mention the source files, they are part of the project. What I want ot do is copy the entire directory containing the project called "Fred" and turn it into a project called "Joan". That includes the exe file name that gets produced.
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1322549
One way I have found is to do this:

If your Main App class is CProject1App, your Files are Project1.cpp, Project1Dlg.cpp, Project1Doc.cpp, etc.....

Make a copy of your entire Project in a new directory (maybe Project2).  Open the project in that directory and do a Find/Replace of Project1 (replace with Project2).  This will rename every instance of the Project1 (of course).  Now this won't change the file names what you can do is rename the files that have Project1 in them to Project2 and include them in your project (deleting the Project1 includes....).

See if this does the trick for you..

J.R.
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 1322550
I once wrote a code generator that had to do exactly the same. mainly you have to alter the entries in the .dsp file, as DevStudio will generate a workspace (.dsw) when opening it. Here's the .dsp template:
# Microsoft Developer Studio Project File - Name="module" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

CFG=module - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "module.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "module.mak" CFG="module - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "module - Win32 Release" (based on\
 "Win32 (x86) Dynamic-Link Library")
!MESSAGE "module - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE

# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe

!IF  "$(CFG)" == "module - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "someplace\include" /I "otherplace\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__DLL" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# Begin Special Build Tool
SOURCE=$(InputPath)
PostBuild_Cmds=copy release\module.dll \project\bin      
# End Special Build Tool

!ELSEIF  "$(CFG)" == "module - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "someplace\include" /I "otherplace\include"  /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "__DLL" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# Begin Special Build Tool
SOURCE=$(InputPath)
PostBuild_Cmds=copy debug\module.dll \project\bin      
# End Special Build Tool

!ENDIF

# Begin Target

# Name "module - Win32 Release"
# Name "module - Win32 Debug"
# Begin Source File

#__codegen_directive("GENIFSRCLST"); => produces source file list

SOURCE=.\module.cpp
# End Source File
# Begin Source File

SOURCE=.\module.rc
# End Source File
# Begin Source File

#__codegen_directive(      "GENCMNSRC"); => produces source code entries here

SOURCE=module1.lib => add implib here!
# End Source File
# Begin Source File

SOURCE=module2.lib => add implib here!
# End Source File
# End Target
# End Project

Simply replace 'module' and 'project' in the example above with the appropriate terms.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 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