|
Post by dc17 on Nov 30, 2022 23:09:10 GMT 1
Hi there,
I'm working on a DOS application for a self storage company. I have successfully emulated the program in vDos, but the only thing not working is the printing.
On the previous system, Win7 I believe, the two printers were the HP laser printer (LPT1) and the Epson receipt printer (LPT2).
They have 3 printouts that they print, customer receipts, miscellaneous receipts, and reports. Customer and misc. receipts would print to LPT2, and the reports would print to LPT1.
But on the new system running vDos, using Win10, the customer receipts and reports would now print to LPT1. For the reports, that is what should happen. However for the cust. receipts, it would output to LPT1, as it shows in the .txt/.asc files in the vDos folder.
All settings in the DOS application were copied over to the vDos emulation.
I also noticed that on the old system, when a customer receipt gets printed, a file gets updated inside the DOS program folder with the contents of the receipt. On the new system, that file is blank with 0kb, although the "date modified" is the same time it "prints". The command to print is /C copy "filename" LPT2 > nul. Could it be that since the file is empty, it defaults to LPT1 instead?
Sorry if this is confusing, I have little to no experience with DOS applications.
Thank you.
|
|
|
Post by Jos on Dec 1, 2022 8:57:21 GMT 1
That’s a puzzle.
When a program outputs data to LPTx, corresponding LPTx.asc and LPTx.txt files are created by vDos. If printing a customer receipt produces LPT1.asc and LPT1.txt, that implies the program is using LPT1, not LPT2. Though what then about the empty file?
That is created by the program, but to what purpose. DOS programs can use LPT1-LPT3, why create an intermediate file, and how did it then store data in that file. To be copied to LPT2 by /C copy “filename” LPT2 > NUL. If the output to LPTx is just white space, vDos will simply ignore that.
It all makes no sense, but perhaps in the past some odd fixes were made to enable the program to run in Windows 32-bit.
I suggest you: Look in the program for some setting to print customer receipts. If "filename" is set, change that to "LPT2". Don’t know where /C copy… comes from, remove that. Add LPT1 = RAW (eventually also LPT2 = RAW) to config.txt. As the Windows Printer Selection Dialog popups, select the appropriate printer. I assume the printer are DOS able.
Jos
|
|
|
Post by dc17 on Dec 1, 2022 19:12:56 GMT 1
Hi Jos, I attached images of the program in "Verbose" mode, which shows what is happening in the background. The program uses SHROOM, or shell room. In the custreceipt, the NRC5R40 is the filename that gets changed, but has 0kb, yet prints to lpt1.txt/asc. In miscreceipt, the MRCR40 file also gets changed and is updated with 1kb showing the actual receipt. This gets printed to lpt2.txt/asc. I actually found the setting to change where it prints, but only misc. receipts. Those swap files that are created are not found in the DOS program folder. So they must get made and erased during the process. I can't change the NRC5R40 or MRCR40 filename within the program. Also using the Windows Printer Selection dialog for the Epson printer does not work, it will say to check the horz/vert settings, Even though it works if it prints to LPT1. Thank you for your help Jos. Attachments:
|
|
|
Post by Jos on Dec 1, 2022 19:50:42 GMT 1
SHROOM is completely useless in vDos (and already was in NTVDM and DOS). It frees 186KB of conventional memory (the program and its data), so there’s 627KB for COMMAND.COM to load and do the COPY. But COMMAND.COM and the COPY command are built-in, vDos only requires some 1 KB for this to function.
You apparently didn’t add LPT1 = RAW and LPT2 = RAW to config.txt. Without those lines vDos will convert the DOS ASCII output to Windows GDI pages. By default 80 characters per line, that won’t fit the narrow receipt printer paper given its low resolution. So the check the horz/vert settings warning.
Jos
|
|
|
Post by dc17 on Dec 1, 2022 20:21:16 GMT 1
I see. Yes, setting LPT1 and LPT2 = RAW now prints using the windows print dialog. I've checked all the settings within the program, but nothing changes the cust. receipt to change to LPT2.
Hopefully they'll be happy with one extra step of using the windows print dialog.
|
|
|
Post by Jos on Dec 1, 2022 21:03:41 GMT 1
You could change LPT2 = RAW to LPT2 = SEL:"Windows_name_miscreceipt_printer" RAW.
Not for the LPT1/cust. receipt since LPT1 is actually the Laser printer. I’m in the dark why the program prints misc.receipt to the MRCR40 file and cust.receipt to LPT1. My guess would be the program uses fixed file handles and SHROOM messes with the DOS file handle table. So, if possible, omit the use of SHROOM.
Jos
|
|