Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CopyFile() revisited - guru's here please...!
Message
De
23/10/2000 15:06:19
 
 
À
23/10/2000 13:46:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00433016
Message ID:
00433095
Vues:
19
>trying to get CopyFile() to work....
>i get the file to print filled up with the info ok. then i have....
>
>if file('jobtkt')
> DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
> STRING @SourceFileName, ;
> STRING @DestFileName, ;
> INTEGER bFailIfExists
> if CopyFile('c:\techprov2.2\jobtkt','PRN:',0) # 0
> *IF CopyFile(cMySourceFileName,cMyPortOrUNC,0) # 0
> *It was copied
> messagebox('File Printed Successfully...',0+64+0,'Printing Information...')
> ELSE
> * it wasn't
> DECLARE INTEGER GetLastError IN KERNEL32.DLL
> errono=GetLastError()
> messagebox('File Printing Error Code - '+alltrim(str(errono)),0+48+0,'Printing Information...')
> ENDIF
>else
> messagebox('Printer file was not created...',0+48+0,'Printer Error....')
>endi
>
>the above come straight out of the FAQ section, but doesn't work. GetLastError() returns error code 2.
>
>if anyone has advice
> i am glued to UT!!
>else
> there is beer in the fridge
>endi
>
>thanx - john

Is the device PRN: defined? NT and 2K do not assign default PRN: devices unless you direct them to in an AUTOEXEC or the OS configuration.
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