Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
USB printing
Message
From
17/06/2003 01:34:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
USB printing
Miscellaneous
Thread ID:
00800688
Message ID:
00800688
Views:
43
Hi!
How can I print text with printer control sequences (PCL codes) to USB
printer bypassing printer driver? I have found this code:

#DEFINE C_OUT_PORT "prn.dos"
******************* Or:
*#DEFINE C_OUT_PORT "PRN:" &&- default
*#DEFINE C_OUT_PORT "LPT1:" &&- LPT1
*******************
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING lpExistingFileName, ; && name of an existing file
STRING lpNewFileName, ; && name of new file
INTEGER bFailIfExists && operation if file exists

IF CopyFile("winpage.$$$", C_OUT_PORT, 0) # 0
ACTIVATE SCREEN
?CHR(7)
=MessageBox('Error!', 16, _SCREEN.Caption)
ELSE
WAIT WINDOW 'Ok!' NOWAIT
ENDIF
CLEAR DLLS
*winpage.$$$ is my text file with PCL codes

It did perfect job with non-USB printers. But when I tried to print to a USB
printer it failed...
If the USB virtual printer port is "USB001", a text file with the same name
is created.
Next
Reply
Map
View

Click here to load this message in the networking platform