views:

130

answers:

5

Hello,

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!

+1  A: 

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?

Gamecat
Sadly,they are not dlls. :-(
John
As to why - I'm usually doing this while debugging communication problems. That way I can trace the handshake (for example) simultaneously in both client and server.
gabr
+2  A: 

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.

Marco van de Voort
Yup one app. But multiple projects if one is a program and the others are dll's. Although it's confuses the debugger sometimes ;-).
Gamecat
Debugger can only debug one process would be better probably. Those other DLLs can be started in the same process, and then they can be debugged.
Marco van de Voort
Unfortunately none of the projects is a dll.But thank you for help!It's sad there's no possibility to run without debugger a whole project group.
John
The debugger CAN run multiple projects from a project group at once. You just cannot start them all at once. How to: Do a build all, start 1st app by clicking run button, select next project, click run etc.
Ritsaert Hornstra
+2  A: 

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

Bruce McGee
+1 for the Ctrl-Shift part, not for the whole answer.
gabr
+12  A: 

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.)

gabr
Sweet! I didn't know we could do this.
Bruce McGee
Excellent find.
yozey
+1 Gabr!! That one is cool! Excelent!
Fabricio Araujo
Accepted,thank you :)
John
+2  A: 

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.

Rob Kennedy