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

WIndows XP & Open Directory & Printing LPT1

Status
Not open for further replies.

steve1222

Technical User
Jan 7, 2003
20
US
Background:
I have an application built with Cliper 5.2D linked with Blinker 3.1 running on Windows NT currently. To solve the printer timing out, I write all to a file, then I shell out and issue the run command to "run copy xyz12345.txt lpt1"
I have coded it so that two users at the same time do not use the same xyz12345.txt file name.

NOW:
The company is going with Windows XP and OPEN DIRECTORY and under this scheme there is no "lpt1". All printers are now listed as devices that you print to. This will be a big headache within the new 2 months as there are over 350 different printers used by over 2000 employees. The printer are listed as by location name and when a project moves to a new loaction, the name also changes.

Any suggestions would be appreciated. Thanks
Steve alias "Clipperhead"
 
Hi, Steve

There are libraries/utilities out there that give you access to windows printers. See thread 288-426318.

Personally, I have started shelling out to wordpad. I print to a disk file and then run wordpad. For example, if I created a report file called c:\repts\spoolrept.txt, then:

x:="wordpad.exe c:\repts\spoolrept.txt"
run &x

I find it works very well - the user gets to view the report on-screen and then can do whatever they want with it: print it to wherever, email to Mom, fax it, save it etc etc. The clipper app hangs suspended until they close wordpad and then resumes. If it is a multi-user app I put the text file in their personal folder.

For it to work Wordpad.exe has to be in the path. XP seems to run the Windows app in a separate memory space, so I haven't had any problems with insufficient memory. Admittedly I haven't done this in any huge apps - the largest is about 430K, so I don't know if it will work in all situations.

I use Wordpad rather than Notepad becaue it understands chr(12) as a page break.

It has saved me endless hassle figuring out site-specific printer setup glitches - if they can print out of Wordpad they can print your report. IT departments don't want to know about DOS apps that can't print, but they have to handle Windows apps that won't.

Jock
 
I have found this PrintFile available as free download in the following link... working excellent.

Read the readMe file provided with that. YOu can set the command line options.. to use that as an automatic print spooler. Any file put in the specified spooler directory will be picked up and printed by the PrintFile.
Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top