I have modified the FileMap.CLW by Ray Goudie so that no parameters are
necessary. The modified version is called FileMap2.CLW. The project is
called FileMap2.PRJ and creates an executable called FileMap2.EXE.  In
this way both his original version and my modified version can exist in
the same directory. The first instance of the program is automatically
the server and the rest are the clients.

Below is the original text by Ray Goudie.  I have commented [**] out the
sections that no longer apply and added new instructions inside (**).  So
when reading, skip the text inside [**] and read the text inside (**).

Robert Fred, Meyer
rfmeyer@ethergate.com

------------------------------------------------------------------------

I have noticed a few postings requesting information on exchanging data
between applications. I needed to do the same thing, so I pulled out my
Win32 programming bible and looked up file mapping.

It wasn't that hard to get an example working and I figured it would be
beneficial to the Clarion community if I shared what I learnt.
So, attached is a working example of a client/server demo that exchanges
data every second.  Five strings and five numbers are pushed by the server
and read by the client.

There is only one program. It loads as a server or a client [* depending on
the command-line parameter supplied. *] It happens to be a CW 5 project, but
the source (* should *) [* will *] compile under CW 4 and CW 2 as well.

[*- Copy the executable to your desktop twice as two shortcuts. Place them side
   by side.
- Edit the properties of the first shortcut and add '/server' to the end of
   the Target. Rename the shortcut to include the word "server" in it.
- Edit the properties of the second shortcut and add '/client' to the end of
   the Target. Rename the shortcut to include the word "client" in it. *]

(* Load clarion, then open the project FileMap2.PRJ and compile it. *)
To start the demo, double-click on the (* program or RUN it from the IDE and it
will list itself as the *) server [* shortcut.*]. After one second, you'll see
data appear on the window. Double-click on the (* program, or RUN it, again
and again, as many times as you with, and each instance will register itself as
the *) client [* shortcut *] and watch the client(*(s)*) mirror the data
coming from the server.

This is a trivial demo to demonstrate how file mapping works. You should be
able to take this example and make it do whatever you require to exchange
data between two Clarion applications. No more need for a disk file or DDE!

(this code is distributed free to the Clarion community and cannot be sold
for profit!)

==========================================================
Ray Goudie					ray@wrapmation.com
Wrapmation, Inc.				www.wrapmation.com
Westmount, Quebec, Canada
