             "Seamless OS/2" - running OS/2 apps from a DOS VDM
                          by Marcus Grber 1992-93
                          mgroeber@compuserve.com

This program allows starting OS/2 applications from the commandline of a DOS
box. The standard output & standard error device are both redirected to the
standard output of the DOS session. Thus, you can use command line
applications of OS/2 just as if they were native DOS apps. For example, I
wrote this program to allow compiling with the OS/2 hosted version of
Microsoft C 7.0 from a DOS session where I could start the compiled programs
right away without having to switch windows.

The executable SO.EXE is a "two headed" program which can be run under OS/2 as
well as under DOS. Unlike a family mode application, these two "heads" are
not identical, i.e. they behave differently in both environments.

Usage is fairly painless: Start SO.EXE in an OS/2 session, and it becomes the
server end of the "dynamic duo". It will offer a named pipe to anybody who
wants it, which is most likely SO.EXE when started from a DOS session: You
can now type

        SO <command>                    e.g. SO nmake so.exe
                                        to execute nmake in an OS/2 session

in a DOS box to have <command> executed as on OS/2 command. Anything sent to
"standard output" or "standard error" of that command will be shown in the DOS
session. The command will be executed in the current directory of the DOS
session, and it will inherit the environment of the OS/2 session in which
SO.EXE was started. The error code of the command is passed back to the DOS
session.

*Note of caution:* If the OS/2 command that is started requires any kind of
keyboard input, it will not continue unless you switch to the OS/2 session and
make the input *there* - if have started SO.EXE in detached mode, you will
have to kill the DOS session from the WPS and the OS/2 session by using a task
monitor... So _don't_ detach it if you can avoid it.

I know that this is annoying, but until somebody tells me how to create
non-blocking reads from named pipes in DOS sessions, I have no idea how to
handle this problem - because as long as no _output_ is sent from the program,
the DOS program is blocked and cannot send _input_ to the waiting task.
Deadlock situation...

---

Testing: I've been using this program for my own work for a couple of months
now, and the basic principle seems to be stable. This latest version has only
be tested on the 2.1 GA US, but previous versions worked under the 2.0 GA as
well.

Named pipes are said to work across networks, so it would be interesting to
see if this program could be extended to attach to pipes on remote serves. For
this, you'll probably have to add the server name in the DOSPIPE.C command
which opens the pipe.

I compiled the included source code using NMAKE from the toolkit, emx 0.8f as
the OS/2 compiler and MSC7 as the DOS compiler. Other compilers should work as
well, but you might have to fix some switches in the makefile.
