Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with CopyFile API to network printer
Message
De
24/04/2003 02:42:54
 
 
À
24/04/2003 01:55:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00781000
Message ID:
00781010
Vues:
31
>The below code works when PRN is local printer, but fails when it is network printer.
>GetLastError() returns 29
>/The system cannot write to the specified device. ERROR_WRITE_FAULT /
>What can I do?
>
>#DEFINE C_OUT_PORT "PRN:"
>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
>
>lcErr = CopyFile("winpage.$$$", C_OUT_PORT, 0)=0
>do while lcErr
> lcRet = messagebox("Error ???",5+16)
> if lcRet<>4
> this.enabled=.t.
> retu
> endif
> lcErr = CopyFile("winpage.$$$", C_OUT_PORT, 0)= 0
>enddo

- Have you redirected the PRN or LPT1 port to the network printer?
- Have you tried the native VFP COPY FILE command?
COPY FILE winpage.$$$ TO PRN
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform