Sending data to printer in QB

Well, here is the bad news... USB printers and such will not work from a pure dos machine to the best of my knowledge. Could they be made to work? Yep. Will they be? Probably not, unless a huge portion of the current customer base demands it. Not very likely.

However, it is almost always possible to print from DOS apps running under Windows to a printer that DOS cannot use. The primary problem with USB printers and such is that in many cases LPRINT doesn't go to the right place. The good news is Windows knows how to use the printer. Now, there are solutions, and I'll go through a couple of them in order.

This first one probably only works if you have networking installed... not a problem on newer versions of Windows. Basically, use this commandline and modify it to your needs:
net use lpt1: \\[computername]\[printername]
Pop your computer's name and the printers share name in there, and it'll map the port. This works for USB, serial, and other wierd interfaces that QB doesn't expect (Even works for the scsi interface publishers printer I've got).

The other option is to have your program print to a file, and then send that file to the printer from a windows app. Normally, you would use notepad, but I came up with a slightly nicer solution. I'm now using a VB program that watches for the specific file, then prints the contents. I'm also using a TSR app that starts with each command prompt, which redirects LPT1 traffic to that file.

So, maybe all this will help someone. I've seen the questions asked a couple times and thought I would pass on what I know.

-Jonathan Simpson

(with the help of the evil lowly servant Agamemnus)

PrintWin - page last edited 2003-08-21 08:31:30 by (home) (edit)
Blast WIKI - by RoboticBoy - edited and tweaked for our evil purposes by Hexadecimal Disaster