views:

38

answers:

3

This must be simple, but I guess I'm searching with the wrong key words.

I have a visual studio solution(2008) that includes two projects (win32). is it possible for one to launch another? they are entirely self sufficient programs.

+1  A: 

If you want one project binaray executing the other, yes, this is possible.

If you want Project1 to be executed before or after the compilation of Project 2:

  • Set Project2 to be dependent of Project1, so Project1 gets compiled first (Menu Project > Project > Project Dependencies)
  • Setup a pre- or post-build-action in Project2 that executes Project1.exe (Project Properties > Build Events > Pre-Build Event or Post-Build Event)
Wolfgang Plaschg
-1 for the `system`, +1 for the rest of the answer.
Matteo Italia
I would give me also a -1 for the `system`, so I removed it from the answer ;)
Wolfgang Plaschg
+2  A: 

Right click on Project. Select Properties. Expand Build Events, select Pre-Build Events. In Command Line put the path to your executable. Use the macro's for this.

If you need one to start before the other then set it to be a dependent of the other. Right click the Solution, select Project Dependencies and choose which project it is dependent on.

graham.reeds
A: 

For independent projects that may need to talk to each other (classic Client/Server) you could use Multiple Startup Projects: http://blogs.msdn.com/b/zainnab/archive/2010/05/10/multiple-startup-projects-vstipenv0015.aspx

zainnab