>>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
>
>Beer??< bg >About all I can help with is what the error code means: "The system cannot find the file specified."
Also, under NT/2K, there is no default device PRN: defined unless you do so explicitly; you can reference defined targets only. If PRN: is undefined, as is normal for NT, then it blows up just like sending to COM7: on a machine that doesn't have a COM7:
Try LPT1: to send to the physical first printer port on the machine.