VOGONS


First post, by MRAM

User metadata
Rank Newbie
Rank
Newbie

Is it possible to extract the output from a 16-bit exe program running in DOSBox to an external program (MS Access or Excel), whilst it is running and input data from the external program to the exe program?

On a 32-bit (Windows 8 ) system I can the run the programs without DOSBox and communicate between the programs with Pipes, but if I try this with DOSBox, the program hangs when I try to Read the output. I need to use DOSBox as the programs needs to run on a 64-bit Windows system.

Reply 2 of 5, by truth_deleted

User metadata

The dosbox.conf has a line labelled [autoexec]. Add your DOS batch jobs there. In your last DOS batch file, add the line: exit; this should allow dosbox to exit. Create a batch file on the host which runs dosbox.exe; this will run the jobs in dosbox.conf.

The host command line would include 32/64-bit commands which output data to a host directory; this directory should be shared with dosbox and the DOS batch jobs. Perhaps add a semi-colon after that part of the script, then have it start the dosbox batch file within that same command line. Given dosbox is operating upon a host directory, has run its jobs, and then has exited; then that output should be available to the host. Add another semi-colon and then add the next 32/64-bit command. A for loop can have this routine work over a set of files or lines of a file.

I have not tested this yet, but this is the way I would try first.

Reply 4 of 5, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Jorpho wrote:

There is a kludgy, unofficial patch that allows DOSBox to interact with the Windows clipboard. That is likely as close as you are going to get.
Re: Printing & clipboard-exchange - kludgy workaround for DOSBox under Windows

Using that kludgy workaround, the way to pipe output to the Windows clipboard is to do something like:

echo "This is for the Windows clipboard" > p:\clipout.tmp

It's ugly and inefficient, but it at least it should work.

Reply 5 of 5, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Here's another almost equally complicated method:
1) create an empty directory;
2) register a change notification from within Windows for that directory;
3) mount a drive pointing to that empty directory;
4) redirect the output to a file in that directory.

The change notification will trigger when the file appears or is changed.
You can read the contents and then delete the file again.
However, it's really not the best idea.