Click here to Skip to main content
15,506,025 members
Articles / Desktop Programming / MFC
Posted 21 Apr 2013


1 bookmarked

Multiple Projects in One Solution

Rate me:
Please Sign up or sign in to vote.
1.00/5 (2 votes)
22 Apr 2013GPL32 min read
Multiple Projects in One Solution

Image 1

Programming Tip for Visual Studio

When creating multiple executables that are closely related, it can be very beneficial to have several projects within one solution.


I needed this when writing my Server and Client TCP applications. The Server was to be run on one computer while the Client runs on another. However, they are so inter-dependent on each other it was helpful to have both in the same solution. I was unable to find clear instructions so I wrote this tip. Here is a link to the article and project that prompted this need: My TCP/IP Article

Using the Tip

Start the project to create a solution and a project in the usual manner, but stop with the New Project dialog displayed. I have used C++ with MFC but I suspect this will work for all languages.

Normally at this stage, I fill in the [Project]Name and the solution name is automatically filled in. Then I click OK and go on. This time, after entering the [Project]Name, enter a solution name. For this example, the [Project]Name is First_Project and the solution name is Two_Project_Solution.


Ok that and complete any selections you may need. The solution explorer should look something like this.


That should all be familiar. In the above image I have jumped ahead a bit and selected the solution rather than the project just to highlight it.

The next step is to create the second project. Right click on the solution and select Add then New Project. The dialog field Location defaults to the location of the current project so just leave that field alone. Go through the same steps as for the first project and click the final OK.

My example named the second project Second_Project.

In the below image I have closed (un-expanded) the two projects so just the project names are shown.


When writing your code, nothing changes. Select the solution and go to work.

The next change is for running your solution. Right click on the Solution and select Set Startup Projects. Here is the dialog.


The default for me was Single startup project. In the image I have changed it to Multiple startup projects and opened the drop down box for the first project to show the options. When working my TCP/IP code, I would set one to Start and the other to Start without debugging. Start obviously implies Start with debugging.

That is it. Happy coding.


Original post: 22 April 2013  

23 April 2013, first image was incorrect, edited title.  


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

QuestionHow Can i Call Page From Second Project Pin
Kashif Ali3-Jul-18 2:01
Kashif Ali3-Jul-18 2:01 
GeneralMy vote of 1 Pin
Manish K. Agarwal26-Apr-13 0:26
Manish K. Agarwal26-Apr-13 0:26 
General[My vote of 1] are you serious?!.. Pin
Seishin#23-Apr-13 1:43
Seishin#23-Apr-13 1:43 
GeneralRe: [My vote of 1] are you serious?!.. Pin
bkelly1326-May-13 8:22
bkelly1326-May-13 8:22 
BugFirst Image Missing Pin
Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)22-Apr-13 21:26
protectorTadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)22-Apr-13 21:26 
AnswerRe: First Image Missing Pin
Clifford Nelson23-Apr-13 6:14
Clifford Nelson23-Apr-13 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.