I'm probably about eight years late with this idea, but could an XP application read a byte of data from a parallel printer port? That was put there by, say a DOS application?
Announcement
Collapse
No announcement yet.
XP DOS communicate via parallel printer port?
Collapse
X
-
Sure. Total Commander for example do it for his "LapLink like" module, that let you transfer files to/from a slave DOS machine on witch you run a small server program.
Bye!-- The universe tends toward maximum irony. Don't push it.
File Extension Seeker - Metasearch engine for file extensions / file types
Online TrID file identifier | TrIDLib - Identify thousands of file formats
-
Chris,
I do not know what you are trying to do but it seems similar a problem I've faced for some old DOS applications in need to get data from a 32Bit application.
We have solved the problem using a 32Bit PowerBasic Console application that comunicates with DOS application reading/writing data at line 24 of the console screen with a foreground color equal to background (so user do not see anything).
When DOS application needs to talk with 32Bit application, it writes on line 24 the command, that run the 32Bit process and waith for sync command. 32bit application reads data from line 24, executes the relevant invoked commands and reply again on line 24 (we use black on black color).
We used a 78 bytes of buffer data. Last 2 bytes (79/80) are used for in sync flags.
If the 2 process has to exchange not big amount of data, this can be a possible methods (this was our case).
With big amount of data, it can be too slow.
Hope this can help.
ErosLast edited by Eros Olmi; 3 Jul 2008, 04:40 PM.
Comment
-
Originally posted by Eros Olmi View PostWe have solved the problem using a 32Bit PowerBasic Console application that comunicates with DOS application reading/writing data at line 24 of the console screen with a foreground color equal to background (so user do not see anything).
Comment
-
Our DOS applications are writtent in CBasic, a very very old Basic from Digital. Our 32Bit applications are written into PowerBasic Console.
We have sources of both so we can change and recompile them all.
I think any application able to read Console screen data as ascii chars can use this method. It is like using a file to exchange data but video, in our case, was simpler.
To read console data from 32Bit console applications you can use the following Windows API:- ReadConsoleOutput: http://msdn.microsoft.com/en-us/libr...65(VS.85).aspx
- ReadConsoleOutputAttribute http://msdn.microsoft.com/en-us/libr...68(VS.85).aspx
- ReadConsoleOutputCharacter http://msdn.microsoft.com/en-us/libr...69(VS.85).aspx
ErosLast edited by Eros Olmi; 3 Jul 2008, 06:05 PM.
Comment
-
Last edited by Paul Dixon; 3 Jul 2008, 05:00 PM.
Comment
-
Does XP program just need to READ a small amount of data provided by the DOS program?
If so, you could SHELL the 32-bit program from your MS-DOS program and put the data on the command-line.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Originally posted by Paul Dixon View PostChris,
open a file and write stuff to it in DOS which can be read back in XP. In practice you'll just be reading from the cached version of the file most of the time so it'll be faster than you might expect.Mike Stefanik
sockettools.com
Comment
-
Originally posted by Eros Olmi View PostTo read console data from 32Bit console applications you can use the following Windows API...
Comment
-
Hi Chris,
attention: attachconsole is only available under WinXP/Vista/2003/2008 OSs.
Another way to get handle is something like:
Code:'---Get handles to STDIN and STDOUT AllocConsole() ghStdin = GetStdHandle(%STD_INPUT_HANDLE) ghStdout = GetStdHandle(%STD_OUTPUT_HANDLE)
Hope this helps.
Ciao
Eros
Comment
-
Originally posted by Eros Olmi View PostIf 32Bit application is executed from a DOS application, a Console window is already allocated, so the 32Bit application will use the same Console as the DOS process.
My problem was, well, me.
Code posted to Source Code Forum - you may recognise some of it...
Comment
-
What a marketing opportunity!
"Why don't we replace that old, obsolete, hard-to-maintain MS-DOS program with a nice new Windows-based program?"
BIAS ALERTS:
A. I have had some BAD experiences with "screen scraping" applications (none of which I created).
B. This is how I put food on the table.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
>"Why don't we let that old MSDOS program interrogate our database?"
Because we don't do MS-DOS anymore, that's why. Hell, we barely 'do' Windows/9x anymore.
But FWIW and if "you" are not "we" ....
If using compilers which support MS-DOS interrupts (PB/MS-DOS) and Windows API calls (PB/CC or PB/Windows) as well as STDOUT/STDIN (eg the same compilers), you can redirect the STDOUT and STDIN of the both programs to files and end up with a client-server application between an MS-DOS and a Windows program, in which the files used serve as the communications channel.
Just a little something to think about........for those who do "do MS-DOS."
MCMMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
if you do not have any control over the msdos program and the information is placed on the screen in formated output and the screen is not scrolling, you can use powerbasic for dos and write a trs program to read the screen.
i wrote a program to do this after there is no keyboard input for something like 2 seconds.
does the data only go one direction.
if you are trying to read printer output and just capture the output there are ways to do that.p purvis
Comment
-
Lots of activity in a thread which started out asking for but one (1) lonely little byte.......Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
Comment