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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foxpro 2.6 Dos Printing in WinNT

Status
Not open for further replies.

Herbie24M

IS-IT--Management
Jan 9, 2003
4
GB
Hello,
We have a legacy app compiled in Foxpro 2.6 for DOS. The PC Running this is a DOS machine logging onto Novell Netware 3.1x. The app lives on the C: drive, the data lives on the server (via mapped N/W Drive). For printing, there is Capture command in the login script "Capture L:1 Q=Queue1".
I need to move this "app" to an NT Machine on the corporate NT Domain. I have installed an NT4.0 Workstation, copied the 'C:\foxpro app folder' onto the new machine. The corprate login script maps the data folder to the server (via Gateway for netware share), and maps a printer \\servername\printqueuename. I have also setup a Net use command to attach the printer to LPT1 sothat anythign printed to LPT1 goes to the N/W pritner.

HOWEVER

Code in Foxpro states this:
** lib_psetup sets up a link to the
** print queue on LPT1. E.g. If the
** print queue is QUEUE1, then the code
** to set up the printer is:
**
** DO lib_psetup WITH "QUEUE1"
**
PROCEDURE lib_psetup
PARAMETERS lib_qname
SET PRINTER TO
SET PRINTER TO \\SPOOLER\NB\Q=&lib_qname
RETURN &&lib_psetup

When I run the app, it fails because of the Lib_Setup info. It can't fnid a 'Q=' command basically cos it doesn't exist in Windows. Is there an easy way to get Foxpro to purely print to LPT1? or is there a way in Windows to "name" a mapped shared printer so that Foxpro will recognise it?
I am not a programmer, just a mere IT Support guy, and I need to rid the company of the Netware server and this is the only remaining stumbling block. It still runs fine thru the DOS PC with Novell mappings.....

Any help appreciated..

Tony
 
I don't have all the answer, but I do know that if "\\servername\printqueuename" doesn't conform to the DOD 8.3 naming standard (including no embedded spaces), you probably won't get it to work. Also the FPD is pretty clear that the "SET PRINTER TO \\SPOOLER\NB\Q=&lib_qname" syntax is strictly for Novell networks.
SET PRINTER TO
[\\<machine name> \<printer name> = <dest>]
or
SET PRINTER TO
[\\SPOOLER [\N] [\F=<expN>] [\B=<banner>] [\C=<expN>] [\P=<expN>]]
[\S=<server>]
[\Q=<queue>]
...
\\<machine name>\<printername> = <dest>

The first format of the network SET PRINTER command spools printer output to a network printer. <machine name> is the network name assigned to your workstation. This name is assigned by the network administrator and must be unique. <printer name> is a name assigned to the printer and is also assigned by the network administrator. LPT1, LPT2 or LPT3 is used to identify the destination (<dest>) of the installed printer.

The second format of the network SET PRINTER command is specifically designed for printing under Novell Advanced Netware version 2.00 or later.


Rick
 
Rick,

Thanks for this. The \\server\printername do fall within DOS 8.3 format. I have passed your Comments onto one of our programmers who is assisting me with this.
It would appear from this that maybe we could point the app to the correct location and remove the \\spooler section.
Cheers

Tony
 
The best approach under NT/2000/XP is to use a NET USE command in Windows to redirect an LPT port to your shared printer, then print to LPT whatever in your app. The method you had is flaky IMO - may work on some setups, doesn't on others.

NET USE LPT3 \\server\sharedprinter

Then

SET PRINTER TO LPT1

in your app.

Also, see sig below for more !

***************************************
Need help running those old FoxPro apps on modern systems?
 
I've often used a short routine to create a printer connection with NET USE. Take a look at it in my post in thread182-718345. The benefit here is that it will give you a message if it fails to make a printer connection. An error message will be returned if the printer or workstation hosting the printer is turned off.

Altough the code does not mention it, it expects SET EXACT ON as part of the program environment.

Once it is connected you can use SET PRITNER TO LPT2.

Why did I choose LPT2 for the remote printer? Imagine 2 users with each having a printer. If both set LPT1 to the other's computer, it could very well become and enddless loop. Since their own printers would be generally connected to LPT1, setting the remote connection to LPT2 would avoid an endless loop as well as allow others to print to their own computer while they print elsewhere.

dbMark

 
Well it's a good idea to NET USE above LPT2 in case there's ever a physical printer on LPT1 on a particular PC. I don't see how redirecting LPT1 on a PC to a shared printer on another PC would create an endless loop though.

PC1
NET USE LPT1 \\PC2\PRINTER

PC2
NET USE LPT2 \\PC1\PRINTER

So if you print to LPT1 on either, the output will come out off the other PC.


***************************************
Need help running those old FoxPro apps on modern systems?
 
fyi, on my w98 machines, I recall having to replace all the commands
set print to
with
set print to lpt1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top