Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a text file to a printer
Message
From
27/09/2001 15:16:57
 
 
To
27/09/2001 07:35:26
Brian O'Donovan
Crescent Computers
Cork, Ireland
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00561339
Message ID:
00561617
Views:
35
The below should work also, I use it to print directly to the printer port for a legacy app that prints to multiple ports setup in DOS via a ROSE box and is running in both Foxpro 2.6 and VFP6 (app is half-way converted and running in both versions during conversion process - I separate vfp specific with compiler directives):

*!* Program Name: copytofile.prg
*!* Purpose: copy directly to a printer port

LPARAMETERS cPCFile,cPCPortorPCUNC,lnother
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING @SourceFileName, ;
STRING @DestFileName, ;
INTEGER bFailIfExists
IF CopyFile(cPCFile,cPCPortorPCUNC,0) # 0
* It was copied successfully
ELSE
* it did not work
ENDIF

* Call this program with any of the following:
* copytoport('C:\MyFile.txt','LPT1:',0)
* copytoport('\\myserver\myshareddirectory\myfile','\\myserver\myprinter',0)
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform