For Programmers: Free Programming Magazines  


Home > Archive > Clipper > January 2007 > Problem with LPT4: on XP: OS-Error 87









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with LPT4: on XP: OS-Error 87
Frank Leverenz

2007-01-19, 6:55 pm

- Clipper 5.3, Tool III
- WinXP sp2 Workstations

On some workstations, printing to LPT4: is OK, but on some I get the
following error:

Configuration is OK:

net use LPT4 \\miclinux\kyo_1900
Der Befehl wurde erfolgreich ausgef=FChrt.

net use
Status Lokal Remote Netzwerk

---------------------------------------------------------------------------
OK LPT4 \\miclinux\kyo_1900 Microsoft
Windows-Netzwerk

If I try to print from console, it works:

type myfile.txt > LPT4:

Print OK.

But if I try to print from the Clipper App, I get:

Subsystem : TERM : 2014
Fehler-No. : 20
Filename : LPT4.PRN
OS-Fehler : 87

Any Idea, why it works on some XP's and on other not?

Ciao
Frank

dlzc

2007-01-19, 6:55 pm

Dear Frank Leverenz:

Frank Leverenz wrote:
> - Clipper 5.3, Tool III
> - WinXP sp2 Workstations
>
> On some workstations, printing to LPT4: is OK, but on some I get the
> following error:
>
> Configuration is OK:
>
> net use LPT4 \\miclinux\kyo_1900

....
> If I try to print from console, it works:
>
> type myfile.txt > LPT4:
>
> Print OK.
>
> But if I try to print from the Clipper App, I get:
>
> Subsystem : TERM : 2014
> Fehler-No. : 20
> Filename : LPT4.PRN
> OS-Fehler : 87
>
> Any Idea, why it works on some XP's and on other not?


If you do a search on google groups, using 2014 and 87, you find this:
http://groups.google.com/group/comp...7dcd903910bfe64
.... and the response by Stephen Quinn. (Printing to LPT6)

Are the programs started differently... the ones that work may be
selected off the Start Menu, while the ones that don't are started off
the desktop?

David A. Smith

Stephen Quinn

2007-01-19, 6:55 pm

David/Frank

If you do a search on google groups, using 2014 and 87, you find this:
http://groups.google.com/group/comp...7dcd903910bfe64
.... and the response by Stephen Quinn. (Printing to LPT6)
<<

What I wrote in that post is slightly incorrect<g>
All 16bit Clipper apps run under COMMAND.COM on NT type systems (the OS
(en)forces this)
[color=darkred]
> net use LPT4 \\miclinux\kyo_1900


Try changing that command to the following and it'll survive reboots
Eg
net use LPT4 \\miclinux\kyo_1900 /PERSISTENT:YES

IIRC you can add LPT4-9 in the system.ini file for those ports to be recognised
(but that may have been for W9x OSes)

HTH
Steve


Klas Engwall

2007-01-19, 6:55 pm

Frank,

>- Clipper 5.3, Tool III
>- WinXP sp2 Workstations
>
>On some workstations, printing to LPT4: is OK, but on some I get the
>following error:


[...]

> Subsystem : TERM : 2014
> Fehler-No. : 20
> Filename : LPT4.PRN
> OS-Fehler : 87
>
>Any Idea, why it works on some XP's and on other not?


You get that error because you SET PRINTER to a device that does not
exist. The environment where you copy a file to LPT4 from the
commandline (the Win32 console) is a completely different one from
where you try to print from the Clipper application (the NTVDM, the NT
Virtual DOS Machine).

Normally there is no support in the VDM for LPT ports other than LPT1,
LPT2 and LPT3. So what surprises me in your question is that you say
that it actually works on some XP machines. IIRC, a Netware client
might add extra LPT devices. That is the only explanation of why it
sometimes works that I can think of.

I suppose you need LPT ports above LPT3 because you have more than
three different networked printers to connect to. The solution is,
instead of setting up all your redirections statically before the
Clipper application is started, to dynamically set up redirection to
each printer, one at a time as the need arises, and then cancel the
redirection after finishing printing. The LM_Redirect() and
LM_KillRedir() functions from my LanMan Library will do that for you.

See http://www.engwall.com/clipper/lanmanlib.htm for details and
download.

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Frank Leverenz

2007-01-20, 7:55 am

Hi David, Steve and Klas,

thanx for your answers.

Here are a few more informations, I found out:

Steve: "net use LPT4 \\miclinux\kyo_1900 /PERSISTENT:YES" won't solve
the problem.


It depends on the Netware client.

I can use LPT1: to LPT3: for Windows-Redirections: net use lpt3
\\windows-pc\printer-share
I can use LPT1: to LPT9: for Netware-Queues: net use lpt9
\\netware-server\queue

But:
I can't use LPT4: to LPT9: for Windows-Printer in Clipper 5.3 Apps.

What I don't understand, is:
No matter if I use "CMD.EXE" or "COMMAND.COM" as the shell:

- "net use LPT4: \\windows-pc\printer-share" works OK
- "copy testfile.txt LPT4" works OK
- "copy testfile.txt LPT4.PRN" works OK
- But: Clipper-Apps can't print to "LPT4.PRN"

Because the stations have more than 3 Windows-Printer-Shares, I'm
looking further for a solution

Frank

N:dlzc D:aol T:com \(dlzc\)

2007-01-20, 6:55 pm

Dear Frank Leverenz:

"Frank Leverenz" <LeVi37@gmail.com> wrote in message
news:1169301068.366606.320790@v45g2000cwv.googlegroups.com...
> Hi David, Steve and Klas,
>
> thanx for your answers.
>
> Here are a few more informations, I found out:
>
> Steve: "net use LPT4 \\miclinux\kyo_1900 /PERSISTENT:YES" won't
> solve
> the problem.
>
>
> It depends on the Netware client.
>
> I can use LPT1: to LPT3: for Windows-Redirections: net use lpt3
> \\windows-pc\printer-share
> I can use LPT1: to LPT9: for Netware-Queues: net use lpt9
> \\netware-server\queue
>
> But:
> I can't use LPT4: to LPT9: for Windows-Printer in Clipper 5.3
> Apps.
>
> What I don't understand, is:
> No matter if I use "CMD.EXE" or "COMMAND.COM" as the shell:
>
> - "net use LPT4: \\windows-pc\printer-share" works OK
> - "copy testfile.txt LPT4" works OK
> - "copy testfile.txt LPT4.PRN" works OK
> - But: Clipper-Apps can't print to "LPT4.PRN"
>
> Because the stations have more than 3 Windows-Printer-Shares,
> I'm
> looking further for a solution


I guess if it was easy, they wouldn't call it work... ;> )

How about rather than printing to a printer, print to a temporary
file (SET ALTERNATE TO), then RUN a batch command to send it to
your printer of choice?

David A. Smith


N:dlzc D:aol T:com \(dlzc\)

2007-01-20, 6:55 pm

Dear Frank Leverenz:

"Frank Leverenz" <LeVi37@gmail.com> wrote in message
news:1169301068.366606.320790@v45g2000cwv.googlegroups.com...
....
> - "net use LPT4: \\windows-pc\printer-share" works OK
> - "copy testfile.txt LPT4" works OK
> - "copy testfile.txt LPT4.PRN" works OK
> - But: Clipper-Apps can't print to "LPT4.PRN"


... and you tried the variants:
SET PRINTER TO "LPT4"
SET PRINTER TO "LPT4:"
? (just checking)

David A. Smith


Klas Engwall

2007-01-20, 6:55 pm

Frank,

>What I don't understand, is:
>No matter if I use "CMD.EXE" or "COMMAND.COM" as the shell:
>
>- "net use LPT4: \\windows-pc\printer-share" works OK
>- "copy testfile.txt LPT4" works OK
>- "copy testfile.txt LPT4.PRN" works OK
>- But: Clipper-Apps can't print to "LPT4.PRN"


Precisely. What you can do at the commandline is completely different
from what a 16-bit DOS application can do when running under the
NTVDM. In Clipper you are stuck with LPT1 - LPT3.

>Because the stations have more than 3 Windows-Printer-Shares, I'm
>looking further for a solution


As I said yesterday, you will have to do those redirections
dynamically. You can use as many printers as you like if you set up
redirection to one printer at a time, send your print job to that
printer and cancel the redirection when done. Then you can set up a
new redirection to a different printer using the same LPTx, and so on.
There is no limit to the number of printers you can use if you do it
that way.

The "ugly" way to do it is to shell out to a batch file that runs the
NET USE commands you need. A better way (one that gives you much more
control) is to use DOS system calls from inside the applicaton. That
is what the LanMan Library does. I have used that method since S87 and
DOS 3.30 plus various redirectors and it is still serving me well
under Clipper 5.x and Windows XP.

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Klas Engwall

2007-01-20, 6:55 pm

David,

>.. and you tried the variants:
>SET PRINTER TO "LPT4"
>SET PRINTER TO "LPT4:"


It doesn't matter how the SET PRINTER command is varied when the
device doesn't exist. It will fail with all variants. And with the
exception of Netware printer shares there is no LPT4 device, so we are
stuck with LPT1 - LPT3.

BTW, a trailing colon should never be used in Clipper. That's what the
manual says :-)

Regards
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
roman modic

2007-01-22, 7:55 am

Hello!

"Klas Engwall" <klas.engwall@nospam.please> wrote in message news:45b2904f.416049317@nntpserver.swip.net...
> Frank,
> Precisely. What you can do at the commandline is completely different
> from what a 16-bit DOS application can do when running under the
> NTVDM. In Clipper you are stuck with LPT1 - LPT3.


I use LPT1 - LPT9 in Windows XP SP2.
But registry change (and restart of spooler service)
is necessary to enable LPT4 (and higher ports):
( HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports )

You can use the following batch file:
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=5696

Regards, Roman


Klas Engwall

2007-01-22, 6:55 pm

Roman,

>I use LPT1 - LPT9 in Windows XP SP2.
>But registry change (and restart of spooler service)
>is necessary to enable LPT4 (and higher ports):
>( HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports )
>
>You can use the following batch file:
>http://www.jsifaq.com/SF/Tips/Tip.aspx?id=5696


Yes, that adds new entries under the Ports sub-tree in the registry,
but what about SET PRINTER TO LPT4 in Clipper?

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
roman modic

2007-01-23, 3:55 am

Hello!

"Klas Engwall" <klas.engwall@nospam.please> wrote in message news:45b54f36.595992251@nntpserver.swip.net...
> Roman,
>
>
> Yes, that adds new entries under the Ports sub-tree in the registry,
> but what about SET PRINTER TO LPT4 in Clipper?


You are correct. I apologise for the wrong advice.
The above setting only adds additional ports in
Add Printer wizard, so that one can install Windows
XP printers with LPT4 port or higher.

I've also browsed our source code and noticed
that we fortunatelly do not use SET PRINTER TO
but are printing with shell command "COPY" ...

Best regards, Roman


Klas Engwall

2007-01-23, 6:55 pm

Roman,

>You are correct. I apologise for the wrong advice.


Oh well, that's life :-). Don't worry about it.

>The above setting only adds additional ports in
>Add Printer wizard, so that one can install Windows
>XP printers with LPT4 port or higher.
>
>I've also browsed our source code and noticed
>that we fortunatelly do not use SET PRINTER TO
>but are printing with shell command "COPY" ...


Then you might want to look into the LanMan Library and do everything
from inside the Clipper application instead of having to rely on
external resources. But of course, "if it ain't broke, don't fix it"
:-)

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
Stephen Quinn

2007-01-23, 9:55 pm

Roman

> I've also browsed our source code and noticed that we fortunatelly do not use
> SET PRINTER TO but are printing with shell command "COPY" ...


If you want to use LPT4 from the shell then make sure you use a CMD.EXE shell
from within your Clipper app, using COMMAND.COM (the default) will probably fail

You could create a CopyToLPT4.CMD file with the relevant command in it
Eg (Check the syntax)
CopyToLPT4.CMD
COPY %1 TO LPT4
or maybe UNC names will work
COPY %1 TO \\SERVERNAME\PRINTERNAME

SwpRunCmd( 'CMD.EXE /C CopyToLPT4.CMD MYFILE2PRINT',etc...)

Either of the following libraries will use the printer at the Windows level
instead of the DOS level
PageScript - http://www.abeelabs.com
Vouch32 - http://www.vouchcac.com/Vouch32/Vouch32.htm

HTH
Steve


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com