Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy (file) PRN
Message
De
12/09/1998 08:45:17
 
 
À
11/09/1998 07:20:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00135417
Message ID:
00135785
Vues:
9
>Hi
>
>
>i create a file from "REPO FORM PRICE_LIST TO FILE F_PL"
>
>
>That file "F_PL" will send to my client to print it by himself.
>
>i had try to use "COPY F_PL PRN" in dos mode to print it out by my standalone PC, it work in fine.
>
>But my client's PC was run on LAN, access the command "COPY F_L PRN" will appear below message on screen
>
>"Write fault error writing device PRN"
>Abrot, Retry, Ign...
>
>I had try to change it to "LPT1", but same result.
>
>And i had try to move the "F_PL" icon into the LAN printer,
>The system will view the file by "Notepad" then print it out.
>But full of printer control code will print too..

The following will copy a file to the default PRN device:
FUNCTION CopyFileToDevicePRN
LPARAMETER cFileToPrint
DECLARE SHORT CopyFile IN Win32API ;
   STRING cFileToCopy, ;
   STRING cTargetFile, ;
   SHORT nFailIfExists

RETURN CopyFile(cFileToPrint,'PRN',0) = 1

* If no device PRN has been defined to the OS, it ain't goinna work
IF CopyFileToDevicePRN('MyPrintFile')
   * The file will be copied to the target device and VFP will not wait on completion
ELSE
   * The copy operation failed to be started
ENDIF
The CopyFileToDevicePRN() function should really be made more robust, since if API call CopyFile() returns a 0, you really need to invoke the API call GetLastError() to get the real return status. But it's a starting place...
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform