7
votes

I have a project group containing two projects that share one source folder,but do different things.What I find strange is the use of 'project group',but I don't want to turn this a subjective question,thereby I directly ask you:

How do I run all the projects in a project group - is there a short way?

Thank you in advance!

6

6 Answers

17
votes

Actually, all of you are wrong. You can debug multiple programs at the same time.

I don't know when this was first implemented, most probably when the project groups were added to the Delphi, but I'm using this since "forewer" and I'm sure that at least Delphi 2005 was capable of doing it.

In short:

  • Create a project group with two programs.
  • Build them all! You won't be able to use the compiler after you start the debugger.
  • Activate the first program (double-click on its name in the Program Manager) and press F9 (run).
  • Activate the second program in the Program Manager (you cannot use the drop-down next to the "Run" toolbar button for that as it will become disabled in the previous step) and press F9.

Voila! You have two programs running under the debugger. You can set breakpoints in any of them and they will work just file.

This approach works with any number of programs. (There may be some hardcoded limitations but I've never run into them.)

2
votes

The debugger can debug only one application (actually: Process) at the time, and if you run from the IDE it is in the debugger.

So I think the answer is : you can't.

Well, I guess unless you count dlls that are launched in the same process, but are individual projects. (seeing the other post), but I never tried that.

2
votes

To run all the projects at once, add a new batch file to your project group. Make the batch file run each program, and when you want to run them all later, simply choose the batch file in the project group and run it. This isn't the same as debugging all the projects, just running them. It's simply a way to automate the procedure given in Bruce's answer.

2
votes

You can only debug one project at a time, but you can run as many as you like from the IDE without debugging.

Shift + Ctrl+ F9

Update: I stand corrected. You can debug multiple projects at the same time. Excellent for debugging a client and a server at the same time.

1
votes

The projectgroup is a tool to build multiple projects. You can select build all from here to build them all.

You can run several from within the debugger if one is a program and the others are dlls that are used by the program.

Multiple programs's can't be run/debugged at the same time.

Although you can use a program as a DLL but I'm not sure if the IDE can handle that use. In that case you can use a main procedure which is the only thing called from the main program. Then you should export this main proc. Create an additional exe project that calls all of them from different threads. I have not tested this. And it is a hack, but it could probably work.

But why do you want to run/debug several apps at the same time?

0
votes

As a side note: Check all dependent projects (right click on project -> Dependencies) to have them build automatically before debugging.