launching on Wintel/inter-process communication

Richard Gaskin ambassador at fourthworld.com
Mon Dec 2 15:45:01 EST 2002


Launching an app with a document on Windows is a snap -- the first time you
do it.  If you run a launch command to launch a given app a second time, as
documented you will get an error.

So how do we open a second document in the currently-running application
instance?

One strategy discussed here earlier is to have the app write a temp file,
which would be seem by a second instance which could simply let the user
know that the app is already running.  But the user may legitimately wonder:
"So what?"  It is a reasonable expectation that double-clicking a document
will launch the appropriate app and display the document.  It seems less
reasonable, certainly less convenient, to tell them they need to switch to
the first instance and hunt down the document in an "Open file" menu item.

Another approach suggested here is that the calling app kills the current
process to open a new instance.  But in this app the user probably cares
about what's currently open in the first intance, and forcing a quit may
cause them to lose data. Plus it just desn't seem polite.

The good thing about the project at hand is that both applications are
written in MetaCard, so I have control over both ends of the communication.

Two options come to mind:

1. Polling
   I hate even typing that word, but have communication take
   place via files written to disk would be simple (but very
   costly to system resources).

2. Sockets
   I could write an Apple event simulator using sockets,
   but I can't be sure the user's system will be at all
   set up with even an IP.

Any other suggestions?

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.1: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the metacard mailing list