[DUG] Sending data between process on same computer on windows

Ross Levis ross at stationplaylist.com
Wed May 9 16:05:05 NZST 2007


I should add that I use a timeout counter in the while loop in case the
service app is not operating or functioning.

 

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Ross Levis
Sent: Wednesday, 9 May 2007 15:57
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Sending data between process on same computer on windows

 

In my case it's in a normal gui application at one end and a service type
application in the other which uses a timer to check for incoming commands.

 

I normally do something like this.

 

ShareRec.Filename := 'Whatever';

ShareRec.Command := 2;

While ShareRec.Command <> 0 do Sleep(10);

 

The service application detects the command = 2, does something with the
filename, and sets command to 0 when finished.  The While loop usually only
executes once so there is no delay for the user.. 

 

You could run this in a thread if it was going to take a while.

 

I didn't know about NewInstance to allocate the object where you need it.
There is still an issue with strings and pointers inside the object.  Simple
records work well enough for me.

 

Ross.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20070509/72ac9e60/attachment-0001.html


More information about the Delphi mailing list