Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary print files
Message
 
À
30/09/1997 10:40:30
Chrita Lee
ProMOS Technology Inc.
Hsinchu, Taiwan
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00050425
Message ID:
00052413
Vues:
51
>>>>>>>does anyone know how to send a binary print file to the printer?
>>>>>>
>>>>>>If you mean file created by REPORT Form ... TO File ... (w/out
>>ASCII
>>clause), then you can just use COPY FILE cFilename TO lpt1, if printer
>>is
>>on lpt1.
>>>>>
>>>>>no they're basically graphics that were printed to a file. i tried
>>it
>>with copy file to lpt1 but it tells me that there is not enough disk
>>space
>>for lpt1. i have 900megs free. the file itself is only about 180k.
>>>>
>>>>I use copy file to lpt1 for up to 500K files at it works ok, but I
>>use
>>Foxpro native files. Try dos copy command to make sure that copying is
>>not
>>an option here.
>>>
>>>from dos copy /b myfile.prn to prn works great.
>>>i can bang from vfp to do this but the dos shell isn't pretty and
>>while
>>it's printing, the rest of the system is basically locked up.
>>>i'm thinking about seeing if i can get the advertising dept to change
>>
>>formats.
>>
>>Gray,
>>
>>If there's an application capable of printing the file (such as
>>Paint),
>>then, in some cases, you can have it print the file for you using,
>>for
>>example, the following syntax:
>>
>>RUN /N7 C:\Program Files\Accessories\MSPAINT.EXE /P
>>C:\WINDOWS\Clouds.bmp
>>
>>This will cause the program to print the file and then close,
>>minimized and
>>inactive.
>>
>>HTH,
>>
>>George
>
> You can use fread(), fwrite(), fopen() (this function is for opening
>
> the printer port only for writing) functions to achieve your goal.
>It
> works just like DOS command copy /b. And you could run DOS
> commands background using Win32API ShellExecute() to prevent
> DOS window from appearing.
>
>Chris Lee

Or you could use FindExecutable to see if a file has an associated application, then ShellExecute to print it.

BTW, neither of these is technically part of what FoxPro (note this) considers to be Win32API. It's SHELL32.DLL.

GEorge
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform