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!

Printing to USB Port from FP2.6 DOS

Status
Not open for further replies.

TonyScarpelli

Programmer
Jan 23, 2003
361
US
Is there a way to print to an USB Port using FoxPro 2.6 for DOS?

Thanks.


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
Tony,
There are a couple ways to approach this. Go to the Keyword Search tab above and enter USB - there are multiple threads you can read about these approaches.

Note: Since these didn't exist when FPD was last updated, there will never be any "native" support.

Rick
 
There are third-party applications which let you do it. The easiest way is to share it from the server as so then you can NET USE an LPT port to say \\server\usbprinter and then print to the LPT port from your FPD app.

***************************************
Need help running those old FoxPro apps on modern systems?
 
Here is how I set up PrintFile and my application:

Installation of PrintFile for use with FoxPro 2.6 DOS

Download PrintFile and unzip it to some directory
(currently on the network in H:\shared\PrintFile)

Run Setup.exe
Turn off "Create startup menu item\..." (you may want this)
This installs PrintFile into c:\Program Files\PrintFile

Run PrintFile
Click on [Settings...]
Set "Enable spooler function"
Set "Show icon on the taskbar"
Reset all other options

Click on [Text file...]
Set "Send to printer"
Click on [OK]

Click on [Save]
Click on [Exit]

Create a shortcut on the Desktop
Point to "C:\Program Files\PrintFile\PRFILE32.EXE" in the target
Name the shortcut "Print File Spooler"
Add " /s:c:\foxpro26\spooler\*.TXT" to the target, no quotes

Copy the shortcut to the User's Startup directory

Create a directory: C:\Foxpro26\Spooler\ (or wherever you want it)

Restart the computer or re-login. This starts and puts PrintFile on taskbar

Any file with the .txt extension put into the c:\foxpro26\spooler directory will be printed to the Default printer

In FoxPro 2.6 DOS application:

Make sure settings in Purchasing Program are set to LPT1

Code to send P.O. .txt file to spooler directory:

IF gnParaPort = 1
mpath = 'C:\FOXPRO26\SPOOLER\'
gcFileName = mpath + 'PO' + alltrim(gcPurNo) + ".TXT"
REPORT FORMAT REQPRINT.FRX TO FILE &gcFileName PDSETUP NOCONSOLE
ELSE
SET PRINTER TO LPT2
ENDIF

I hope this helps anyone interested in printing to USB ports from FoxPro 2.6 DOS. This is a nice little program and the author, Peter Lerup, should get a prize for this one.

CU


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
I am pretty sure you can capture the printer port in Windows.

Start->settings->printers

Rt click on the printer

choose properties

There should be a option to capture the port. Assign it to LPT1. Anything that prints to LPT1 will then print to the USB port.
 
Thanks.

I'm running Windows 2000 and I can't see anywhere where there is an option to capture an USB port.

Sorry.

However, the printing method that that I posted on Dec 18, has been working fine for my users using the 'PrintFile' utility. I guess in essence, it is capturing the port.

CU


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top