1. Computing

Readers Respond: Real World Examples Needed: Why/What do you Send Between Delphi Applications?

Responses: 22


Windows messages

We have little communication, but the few cases, are covered by windows messages (PostMessage). In case we need more info, the sender write info ona shared buffer (generally registry) that the receiver read. There's another case, where we are using RemObjects; among the channels it have, there is a WindowsMessage one.
—Guest Guillermo

Pipes, Sockets mailslots

I have a large (60k lines of code) project which has a GUI maintained in D5 (i nightmare these days) and a engine written in d2007 now. I use a pipe and a socket to allow communication between the two either locally or over a network. I basically use the GUI to create a setup which a DOS based program can process either locally on a server. I use a pipe or a socket to pass the output back to the GUI for the user.

Named Pipes or Mailslots

When getting one program to update the diaply of another across a network, I use Mailslots. Although their delivery is not guaranteed, and so cannot be used for critical messages, they do work across an entire domain, even with the possibility of sending the mailslot to every machine on the network. This is how Microsoft's early IM, WinPopop, used to work. Now I use Named Pipes more. Guaranteed delivery and even used as a mechanism for communicating with SQL Server. Can communicate across a network but only to one PC at a time, not a global broadcast if this is needed. If the applications are guaranteed to reside on the same PC then Windows messages are still useful. But not in Services any more from Windows Vista - you have to use Named Pipes to communicate with a Service.
—Guest J


With sockets your program can communicate on a same machine or throught the internet. Best for me.
—Guest yome

Communication for application automation

I usually needs one application to drive another one. For example I made a specialised text processor so the main app would instruct the WP to create a new document using a specific template (amongst 140 templates) then later when certain conditions where met, the WP would turn the document into a pdf without direct user intervention. I send messages with parameters between apps and it works fine.
—Guest Didiergm

I use pipes or sockets.

Hi, good point. I prefer to split my Systems into several single exe-files and let them communicate through pipes or sockets. But I think, such things would be perfect to integrate into Delphi 20xx inside TApplication. I am also missing TApplication.UniqueInstance property and have you ever wondered why TApplication is not the Root-Node in Delphi's "Structure" window ?
—Guest sam


I send text commands between two (actually a master and several clients) programs telling each other what to do and what has been done. In addintion, the clients regularly send the filename of a picture of what they currently "see". Each of the programs can run on the same computer or on any other computer on the network. No, it is not spyware but an application for automatically gathering data on road conditions running on sevaral vehicles in our fleet.
—Guest dummzeuch

©2014 About.com. All rights reserved.