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

Using USB via LPT

Status
Not open for further replies.

slicardie

IS-IT--Management
Apr 16, 2002
136
LU
Hi guys. I have a program written in Fox 2.6 that sends printings on the LPT port, but I need to know if there is a way to print through a USB one. I was reading about the option "Set printer", but it seems that it only recognises COM or LPT ports... how do I specify that I want to use a USB port for printing??
 
Fox recognizes printer names too, if you are printing through Windows:

SET PRINTER TO 'MyLaserJet4'

Just set the printer up in the add printer wizard and you can use it. If youare printing through DOS without windows, I think you're out of luck.

Dave S.
 
Thanks Dave. But what happens if, lets say, I distribute this program among a lot of people and some of them have USB printers and some others have LPT's? Is there any way to make a kind of "universal connection" to the printer port?
 
Thanks Dave. But what happens if, lets say, I distribute this program among a lot of people and some of them have USB printers and some others have LPT's? Is there any way to make a kind of "universal connection" to the printer port?
 
USB wasn't around when Fox 2.x came out. So Fox needs to rely on the OS to do the printing. The best you can hope for in this case is that they have a default printer set up.

Dave S.
 
Then it's hopeless :(... 'cause I tried to print on a computer that has a USB printer as the default one, and Fox "told" me that there was no printer installed...
 
One piece of the puzzle that hasn't been clarified is if you are in FPW 2.6 or FPD 2.6.

If FPD, then all of the above is accurate and you are out of luck.

However, if FPW, then you might be in luck.
Assuming that you can eliminate your SET PRINTER TO LPTn: statement(s), then you can cause the FPW to default to your Windows Default printer (USB, LPT, COM, or whatever) or you can allow the user to specify the printer that they choose with a =SYS(1037)

Good Luck,
jrbbldr
jrbbldr@yahoo.com
 
I'm using FPW. I have a lot of statements for printing, but here's a example of one of them: REPORT FORMAT Myreport.frx TO PRINT PROMPT NOCO. So, whenever someone tries to print, Windows automatically prompts in order to select the desired printer. BUT if there is no printer on the LPT port, and there is only a USB printer available, then Fox returns an error message, which is "printer not ready" (error 125). What am I doing wrong?
 
Look throughout your code and see if you issue a
SET PRINTER TO LPTn:
or such command ANYWHERE in your program. If so, then comment it out and try printing without it.

As I mentioned in another response to a very similar question, my own FPW development system has a USB printer on it and everything works well.

Since FPW was developed to be native to the Windows environment (yeah, it started with Win 3.1, but it continues to work) and since I want my applications to depend on Windows for the printer interface and driver, I do the following:
1. Develop all of my reports within Foxpro's Report screens which allows me access to my Windows Fonts, etc..
2. Leave out any statements in the code refering to SET PRINTER .....

It seems to continue working for me and for my client's applications.

Good Luck,
jrbbldr
jrbbldr@yahoo.com






 
I looked throughout the code and I didn't find any SET PRINTER TO statement. I also traced the code, and found what I said before: The statement that actually sends to print is "REPORT FORMAT myreport.frx TO PRINT PROMPT NOCO", and it always returns error code 125. Do you (jrbbldr)think that I have to use =sys(1037)? And if you do, how can I replace the statement above? (report format...)
 
Make a test by commenting out the current REPORT FORM line and replacing it with just:
REPORT FORM myreport TO PRINT

You should not HAVE to use the =SYS(1037) command unless you wish to allow the users to interactively select their own Windows Printer each time.

As I stated previously my own Foxpro 2.6 for Windows works fine with my USB printer. I use no SET PRINTER commands and no PROMPT's except sometimes I include the =SYS(1037) if my client's applications require it.

If this does not solve your problem and if you continue to have problems, get in touch with me via email and we'll see what else we might discover. Once we discover the problem, we'll publish the answer to this site/thread so that others might benefit from what we find.

Good Luck,
jrbbldr
jrbbldr@yahoo.com
 
You might also look at Rick (rgbean) last posting to"
thread182-328612

Good Luck,
jrbbldr
jrbbldr@yahoo.com
 
Thanks a lot jrbbldr! Unfortunately, I don't have the USB printer at this time... when I have it again, I'll try and tell you what happens. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top