Solved

Renaming a Project

Posted on 1998-09-24
4
428 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ffmpeg - "rtsp://...... Operation not permitted" 4 68
has77  challenge 9 67
wordmultiple challenge 12 89
Detect file exist or not 3 77
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

17 Experts available now in Live!

Get 1:1 Help Now