Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a file to a local printer
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00415780
Message ID:
00415818
Views:
19
>Recently, I've had the need to send files directly to a printer port. I have had success copying files to network printer ports, but not to physical printer ports (i.e. LPT1). As long as LPT1 is a captured port, the copy file myfile.pcl to LPT1 command works, but I get mixed results when LPT1 is actually a local printer. One system I get File access is denied. On my work system, I get Invalid Seek Offset and at home I get the blue screen of death!
>
>Even the API call to CopyFile fails. I can think of no other ways to copy a file to a local printer port. Has anyone every done this with success? Am I missing something?
>
>I'm currently using Vfp 5.0a (but at home I have VFP 6 and got the blue screen of death as I mention above).
>

You've not provided us with the return from GetLastError(), so this is a SWAG at best, but the most common errors people make are:

- failing to pass a 0 as the third parameter, to tell it not to fail if the target exists
- misspecifying the port name; the default printer port is LPT1:, not LPT or LPT1
- naming an unassigned device; under NT/2K, there is no default device assigned to PRN:
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform