VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

H-a-l-9000's Megabuild includes an option for direct printing to an lpt port and it's obviously useful to a lot of people.

I've been working on a project that would use DOSBox for printing, and I realized that it might be possible to setup the "real lpt" option automatically by finding the address of the lpt port and writing it to the config file before launching DOSBox.

So I've been trying to put together an AutoIt script that would find the addresses of the lpt port so it can write it into the conf file. It seems to work on some systems, but it gives the wrong address on other systems. I'm posting a link to it here in case anyone finds it useful and can figure out how to make it more reliable.

It works by reading some binary data from the Windows registry, and finding four bytes in that data, which may not always be in the same place.
Also, as written, it only works on a system with one parallel port, because I don't have a system with two parallel ports to work with. If it's of any use to anyone, here it is (AutoIt script and compiled executable):

https://dl.dropbox.com/u/271144/GetParPortAddresses.zip

EDIT After thinking about this some more, I see that I need to test whether the real lpt port is a standard LPT port or whether it has ECP capabilities - and then I should only report the second port address if ECP capabilities are present. I'll get this fixed before too long, I hope.

Reply 1 of 1, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I've now updated the AutoIt script and executable so that:

(1) It tries to detect whether ECP capability is present or not (relying on a string in the Registry - very unreliable, probably) and

(2) It returns the correct addresses on 64-bit systems (tested on exactly one 64-bit system).

For what it's worth in automating a Megabuild or other parallel-port-supporting setup, here it is. Same download link as in the first post.