Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question about project location from a confused indivdual.

Status
Not open for further replies.

miltonic

Programmer
Jun 24, 2002
5
US
I'm sure this is really simple to set up, but I've wasted many an hour trying to figure it out. Any Visual C++ developers want to show me the light?

My problem:
I'm creating a Win32 DLL project, and I'm having trouble setting up a simple loaction for the project. I want to name the project 'cshell', but I want the .dsp, source, header and resource files in a subdirectory called '../cshell/src'. If I make the location 'cshell/src' and name the project cshell, all the files are stored in 'cshell/src/cshell/', which is bad. So how can I name my project cshell, and have all the files associated with that project stored in a subdirectory? Such as cshell/src ?

Thanks for even taking the time to even read this.
 
The only real problem is that way the wizard creates the files for you. Just go ahead and let it create them, then remove them from the project, put your source files in the SRC folder and then include those in the project.

So, create a folder called Projects and give that as the location when creating the DLL. When creating give it a project name of CSHELL and let the wizard do its thing. This will make a folder called PROJECTS\CSHELL will all the source files in it. Then delete them from the project, make the SRC folder and move your source files into it. Then back in the development environment use Project/Add To Project/Files... to select the files from the SRC folder to add. Then when you create new files, just make sure you create them in the SRC folder and everything should stay the way you like it.
 
Close Project and edit Your project File chell.dsp with a text editor. You find in the file lines like:
SOURCE=.\StdAfx.cpp

Change them to:
SOURCE=.\src\StdAfx.cpp

and You will have You heeds.
Another way, You can make a subproject in src - folder, but the first way will be easierfor You.
 
All your answers were helpful, but the solution that fits best for me was tchouch's first suggestion. The only problem with it is that when I edit the file, there is no SOURCE=.StdAfx.cpp line anywhere. Are you sure this is in the .dsp file? I did a 'find' for StdAfx in the .dsp file and found no matches. I searched for source but found nothing that looked close to the SOURCE=.\StdAfx.cpp

You have the exact idea though, this is what I'm trying to find and it's almost solved, any last suggestions? Thanks!
 
StdAfx.cpp is standard file generated AppWizard for MFC - Projects. If You do not have it, You do not need it too. Edin lines with another files.
 
Forgive me tchouch, but I didn't understand your last reply. My project isn't using MFC, it is actually a Win32 DLL project. Is there an equivalent solution similar for a DLL project? Sorry but I'm confused.
 
You have some *.c and/or *.cpp files in Your project (at least one). Suppose, Your files are cshell.c and myverygoodfile.cpp. Then in Your project File chell.dsp You will have these lines:

SOURCE=.\cshell.c
...
SOURCE=.\myverygoodfile.cpp

Change these lines to:
SOURCE=.\src\cshell.c
...
SOURCE=.\src\myverygoodfile.cpp

(or use another path You wish)

create src - folder, shift these files into the folder and You can work with them. It is all You needs.
 
Thanks for the help tchouch, that helped me a ton.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top