Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with CopyFile API to network printer
Message
From
24/04/2003 01:55:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Problem with CopyFile API to network printer
Miscellaneous
Thread ID:
00781000
Message ID:
00781000
Views:
55
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
Next
Reply
Map
View

Click here to load this message in the networking platform