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!

PRINTER PORTS

Status
Not open for further replies.

tlaakso

Programmer
Mar 13, 2002
17
0
0
ES
I know we have talked much about this but still I don't find the solution to my problem.
I have a Novell Netware and a clipper application. I use Clipper 5.3b and blinker 5.10.
Some of my computers,running Win98 and Win2000, have two local printers. At LPT1 an impact printer, and at LPT2 a laser printer. From the clipper aplication I try to print to the laser printer trough LPT2 but it doesn't work. I use:

SET PRINTER TO LPT2
SET DEVICE TO PRINTER
SET CONSOLE OFF
print ....
SET DEVICE TO SCREEN
SET CONSOLE ON

The program does not print and it reports an error trying to create a file LPT2.PRN.
At Tek-tips you always talk about using 'net use', but this is not my case because they are not net printers, but local printers. [sad]
 
I've before described a way to write directly to a shared printer as if it where a file. You'd have to open the "\\computer\printername" file, and ignore the fact (in errorsys or a replacement errorhandler) that the runtime system can't verify the write.
A disadvantage is that the printer has to be shared to make this work.
A search in this forum should bring back this info.

I'd be interested to know why it creates the .prn file, and I'm sure there's a 'rocksolid' reason for that, but can't help here as I can't simulate your confiuration, and don't know any reason, sorry.

HTH
TonHu
 
Hi, TonHu

I think it is trying to create LPT2.PRN because it is W2K and so does not have direct access to the hardware port. The printer driver either a) does not support capturing DOS ports or b) has not been configured to do so and so from the point of view of the clipper ap LPT2 does not exist as a device and consequently it tries to create it as a file with the default .prn extension.

Just my interpretation however. I don't have any LPT2 either.

Jock
 
What are you using for the second printer port? In the old days of ISA cards you had a standard port address but this is not always the case with PCI cards. This is a bit of a fludge but worth a try. Share the port and then do a
NET USE LPT3 \\COMPUTER\PRINTER /PERSISTENT:YES
Then try printing to LPT3 instead of LPT2. This might just work since in 2K/XP, at least with Clipper 5.2, port redirection works exactly how it should.

Ian Boys
DTE Systems Ltd
 
Try this:

local OldSet Set(SET_DEFAULT, "")
...
SET PRINTER TO LPT2
SET DEVICE TO PRINTER
SET CONSOLE OFF
print ....
SET DEVICE TO SCREEN
SET CONSOLE ON
...
Set(SET_DEFAULT, OldSet)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top