Hi Nick,

Multi-threading in VFP is only possible using the MTDLL runtime. This means
you need at least one COM server that acts as the main program for the new
thread. To launch an MTDLL in a different thread, you need a little bit of
C/C++ code which you can download from http://www.foxpert.com/dmult.zip.

Due to the requirement of using a separate DLL for threads there are only
few differences between multiple threads and multiple process for a VFP
developer. With multiple threads your application needs less memory and you
can use more and faster interprocess communication means. As far as VFP
specific resources are concerned (public variables, obejcts, cursors,
datasessions, etc.) each thread is a completely isolated instance.

> The problem is how to open and control (if necessary) each .exe from the
incoming 'Listener' application.

I'd use named pipes for that. The server creates the named pipe setting the
number of pipes to PIPE_UNLIMITED_INSTANCES. Then each VFP EXE can open the
other end of the pipe. When the server tries to connect to a pipe, Windows
automatically searches the list of servers for the next available pipe and
connects that. On MSDN start reading with the CreateNamedPipe function.
There's a whole C++ sample for a multi-threaded named pipe server.

-- 
Christof



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to