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

Foxpro Dos under XP cannot print on network printer

Status
Not open for further replies.

codo

IS-IT--Management
Oct 31, 2001
187
ID
I'm running a Foxpro for Dos program on my windows XP and tried to print through another printer installed on antother XP/98 machine but the printer doesn't gave any respond. The printer is dot matrix printer.
I can do print test page and it works but not if i print from under DOS program. It can only print if i set the print on the local XP machine.
 
Does the shared printer have a correct naming convention for DOS based apps. You cant use spaces etc
Try change the shared printer name to something very basic like Print1
 
Typically DOS programs can print only to local LPT ports. Try this on computer where your DOS program is:

open command prompt and type
Code:
net use LPT3 \\pcname\sharedprinter /persistent:yes
where 'pcname' is remote PC and 'sharedprinter' is sharename for shared printer.
This will make virtual LPT port on your pc which will be mapped to remote shared printer. Switch /persistent:yes will restore this mapping on next logons.

Then create new local printer connected to port LPT3 using shared printer's driver (in Add printer wizard choose Local printer and uncheck Automatically detect). Test it from Windows.

Change in your DOS program settings printer port to LPT3, it should be possible, and try to print from DOS program, it should work.

===
Karlis
ECDL; MCSA
 
I've tried it using EDIT program and it works to print through LPT3 port, but unfortunately my DOS EXE program doesn't have printer setup to set the printer port so it always directly goes to LPT1. how to direct the LPT1 to LPT3 port?
 
As mentioned, the program is most likely printing directly to the printer hardware port, instead of "properly" by using the Windows API.

You wouldn't redirect the LPT1 to LPT3, you would instead redirect the LPT1 to your network share.

net use LPT1: \\pcname\sharedprinter /persistent:yes

(as mentioned above). NOW, if your software "behaves", and prints using the printer BIOS calls, this may intercept it, and route it over to your network printer. If it doesn't print, you can try one other trick.

Go into your printer control panel, and add your dot matrix printer drivers to LPT1, just as if you were going to connect the printer directly. THEN, turn on Printer Pooling between LPT1 and your shared network printer. If you're lucky, your DOS program will try to print to LPT1, but Windows will say "Oh, LPT1 isn't available.... but it's pooled with this printer over here...." and route your print job to your network printer.



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top