General information
Category:
Reports & Report designer
Title:
Problem with CopyFile API to network printer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only