17

Is it possible to create an "application group" which would run under one window, but in separate processes, like in Chrome browser? I'd like to divide one application into multiple parts, so that one crashing or jamming process cannot take down others, but still keep the look and feel as close to original system as possible.

I know the Chrome source is available, but is there anything even half ready made for Delphi?

Harriv
  • 6,029
  • 6
  • 44
  • 76

6 Answers6

8

I guess basically you would create multiple processes each of which creates a window/form. One of the processes has the master window in which every child window is embedded. That is as simple as calling SetParent. The windows in different processes would talk to each other using an IPC (Inter Process Communication) mechanism like named pipes or window messages.

See this question for an embedding example of using SetParent in Delphi. See this question for an example of using named pipes in Delphi.

Community
  • 1
  • 1
Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
8

Have a look at the Delphi code of HeidiSQL. It's a great open source MySQL client that implements this mechanism.

Read this newsitem that was posted when Chrome was released:

"Google playing catch-up with HeidiSQL?"

:-)

HeidiSQL
(source: heidisql.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
4

Harriv, you can use a scheme based on plugins. where you have a main application and this dynamically load news functionality. There are several libraries available here I leave some.

alt text
(source: wikimedia.org)

Frameworks

Tutorials

Bye.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • 1
    Thanks, but I'm really looking for multiprocessing, not plugin architecture. – Harriv Sep 21 '09 at 18:35
  • Lars, a proposal to use Plugins is an alternative to the submitted to in question, due to the high complexity involved in developing a system "like Chrome application" because "Google Chrome" implements a multi-process architecture has besides sandboxing,process administration, rendering isolated (the renderer), and many more. – RRUZ Sep 21 '09 at 19:56
4

Have a look at : http://blogs.microsoft.co.il/blogs/maxim/archive/2008/09/23/curiosity-killed-the-programmer-multiprocess-browser.aspx . The source of the app is in CSharp. I'm sure you can adapt it to Delphi.

TwinForms
  • 166
  • 2
-1

You can separate your application logic and execute it in several threads. That way, if one part of your application logic hangs up, you still have a responsive application. But you won't be able to put the GUI in multiple threads. The VCL requires you to execute all GUI related stuff in the main thread.

jpfollenius
  • 16,456
  • 10
  • 90
  • 156
  • Thank you for suggestion, but I'm using some ActiveX components which need to run in main thread. – Harriv Sep 21 '09 at 18:34
-5

I am not sure about how Delphi operates but the standard procedure for multiprocess programming is forking.

You fork a new process with whatever code you want. Pass information to the forked process and let it run doing whatever it wants.

Can't explain multiprocess programming in one thread response. But look it up.

Dmitriy Likhten
  • 5,076
  • 7
  • 36
  • 47
  • 3
    -1. Since *fork* is a Unix term, I assume you mean it in the generic sense of "starting another process." In that case, you answer is, "multiprocess programming is starting multiple processes," which is an unhelpful tautology. Also, "look it up" is never a helpful answer. Please either explain how multiprocess programming works or provide links (with summaries). – Rob Kennedy Sep 21 '09 at 20:55