Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing to dot matrix
Message
From
18/08/2001 04:57:40
 
 
To
15/08/2001 13:49:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00538025
Message ID:
00545815
Views:
19
>hi Sam
>
>i have an app where 'tickets' are printed in draft mode to a dm printer. the easiest and fastest way to accomplish this is with the CopyFile API. below is a working example that can be fleshed out to suite your needs. what you do is write the report by hand like in the old days, with all the printer codes you want, and then print it to a text file. use the CopyFile() API to send it to the printer. with all the epson printers (and many other brands), i have found that the FX-80 printer driver works fine as a 'generic' type driver.
>
>if file("yourfile.txt")
>DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
>STRING @SourceFileName, ;
>STRING @DestFileName, ;
>INTEGER bFailIfExists
>CopyFile("yourfile.txt","LPT1:",0)
>else
>messagebox('File not available for printing...',0+48+0,'Printer Error....')
>endi
>*The following are valid examples of invoking CopyFile() after it was DECLARED:
>*CopyFile('C:\MyFile','LPT1:',0) && LPT1:
>*CopyFile('D:\Temp\MyFile','PRN:',0) && the default printer
>*CopyFile('\\MyServer\MyShare\MyFile','\\SomeServer\SharedPrinter',0)
>

Gee, that looks familiar...
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