Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POS Printing

Status
Not open for further replies.

tondi

Technical User
Nov 29, 2001
115
0
0
US
Keyword search hasn't worked recently so I need to ask for help again.

I need to bypass Win default printer and print directly to LPT1 or LPT2 as needed directly from app. I have a table with Printer Ports which we refernece in the code. Am running FPW26, Win98 and need to access two LOCAL LPT ports and/or a serial port. I know Win2K and XP are challenges (insurmountable ?) but this should work for users on Win98 computers. I cannot use ??? because that creates GPF printing errors for those users who are running on WinXP and/or Win2K computers.

Certainly there are other apps out there, POS and otherwise, which access multiple ports directly and redirect printing automatically from the compiled program.

Please help ...
 
Are you going to only use win98 or are you going to use a combination of OS that will have to work with the ports differently?

If you are using different operating systems you should be able to determine which os is running using OS(1) and then based on that setting use the SET PRINTER TO LPT1 or LPT2 for WIN98 prior to printing your report.

(Im not sure what to tell you on XP although 2000 should work if you capture the printer ports)

you may have already tried this... :)

Nimmist
 
Win 2000 and XP will not let you access printer or serial ports directly. They have totally taken control of the hardware. You will need to set up printers or rather, different printer names for each of them, and in your code issue a SET PRINTER TO NAME 'PrinterOnLPT1' or SET PRINTER TO NAME 'PrinterOnLPT2'.
You may be able to do a ??? at that point, I'm not sure. If not, I know ? and ?? wil work, I have used that method.
Dave S.
 
I print to com ports by redirecting lpt2.
When you start your app put two lines in the startup
!mode com1 96,n,8,1
!mode lpt2 = com1
(you could run these without the bang by putting the lines into a batch file before you start)
You then use SET PRINTER TO LPT2 to print.

You can most definitely print like this in Windows XP.
The problem is, XP MUST spool for a default 15 seconds.
This can be changed to 1 second (see "FPW2.6 printing on XP" thread in this forum.
You may need to install a generic dot matrix on LPT2 (I don't).
 
You may need to use use "capture a printer port" from the details tag of the printer properties - the printers may be local or remote. In your code store the port (eg LPT2, COM1 etc) to a variable called _port.

Then use the following

private _pdefault
store sys(6) to _pdefault
set printer to &(_port)
set printer on
* print using ? and ?? commands etc
eject page
set printer off
set printer to &(_pdefault)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top