Hi ABBKlaus
I really appreciate your library, and use it a lot in my programs.
But recently I saw need to be able to check the status of the list of installed printers,
so as to indicate any that were not available for use in the selection.
For example: printer is turned off, out of paper, paper jammed, out of ink, etc.
I tried using your Print_GetStatus(#PRINT_STATUS) to try to get that info, but all I get is
status = 0,
and Debug Print_GetLastError() always gives the message:
"The data area passed to a system call is too small" , even on valid online printers.
When I use the #PRINT_ATTRIBUTES type, it works fine. Different attributes are listed.
(I'm using PB4.61 on XP Pro)
I think I'm using the command right, but if not, could you please correct me as to
what I'm doing wrong? Thank you very much for any help or ideas.
I used the following code for trying to get this info.
I select the test printer by commenting or un commenting out.
Code:
selprn$="Canon i550" ;valid printer but turned off
;selprn$="WorkForce 610(Network)" ;valid network printer online and working
;selprn$="Brother HL-1440 series" ;valid network printer out of paper
;selprn$="false printer test"
If Print_OpenPrinter(selprn$,"PAPERSIZE="+Str(#DMPAPER_LETTER)+",ORIENTATION="+Str(#DMORIENT_PORTRAIT),#PRINTER_ALL_ACCESS)
status=Print_GetStatus(#PRINT_STATUS)
If status<>0
If status & #PRINTER_STATUS_BUSY
Debug "#PRINTER_STATUS_BUSY"
EndIf
If status & #PRINTER_STATUS_DOOR_OPEN
Debug "#PRINTER_STATUS_DOOR_OPEN"
EndIf
If status & #PRINTER_STATUS_ERROR
Debug "#PRINTER_STATUS_ERROR"
EndIf
If status & #PRINTER_STATUS_INITIALIZING
Debug "#PRINTER_STATUS_INITIALIZING"
EndIf
If status & #PRINTER_STATUS_IO_ACTIVE
Debug "#PRINTER_STATUS_IO_ACTIVE"
EndIf
If status & #PRINTER_STATUS_MANUAL_FEED
Debug "#PRINTER_STATUS_MANUAL_FEED"
EndIf
If status & #PRINTER_STATUS_NO_TONER
Debug "#PRINTER_STATUS_NO_TONER"
EndIf
If status & #PRINTER_STATUS_NOT_AVAILABLE
Debug "#PRINTER_STATUS_NOT_AVAILABLE"
EndIf
If status & #PRINTER_STATUS_OFFLINE
Debug "#PRINTER_STATUS_OFFLINE"
EndIf
If status & #PRINTER_STATUS_OUT_OF_MEMORY
Debug "#PRINTER_STATUS_OUT_OF_MEMORY"
EndIf
If status & #PRINTER_STATUS_OUTPUT_BIN_FULL
Debug "#PRINTER_STATUS_OUTPUT_BIN_FULL"
EndIf
If status & #PRINTER_STATUS_PAGE_PUNT
Debug "#PRINTER_STATUS_PAGE_PUNT"
EndIf
If status & #PRINTER_STATUS_PAPER_JAM
Debug "#PRINTER_STATUS_PAPER_JAM"
EndIf
If status & #PRINTER_STATUS_PAPER_OUT
Debug "#PRINTER_STATUS_PAPER_OUT"
EndIf
If status & #PRINTER_STATUS_PAPER_PROBLEM
Debug "#PRINTER_STATUS_PAPER_PROBLEM"
EndIf
If status & #PRINTER_STATUS_PAUSED
Debug "#PRINTER_STATUS_PAUSED"
EndIf
If status & #PRINTER_STATUS_PENDING_DELETION
Debug "#PRINTER_STATUS_PENDING_DELETION"
EndIf
If status & #PRINTER_STATUS_POWER_SAVE
Debug "#PRINTER_STATUS_POWER_SAVE"
EndIf
If status & #PRINTER_STATUS_PRINTING
Debug "#PRINTER_STATUS_PRINTING"
EndIf
If status & #PRINTER_STATUS_PROCESSING
Debug "#PRINTER_STATUS_PROCESSING"
EndIf
If status & #PRINTER_STATUS_SERVER_UNKNOWN
Debug "#PRINTER_STATUS_SERVER_UNKNOWN"
EndIf
If status & #PRINTER_STATUS_TONER_LOW
Debug "#PRINTER_STATUS_TONER_LOW"
EndIf
If status & #PRINTER_STATUS_USER_INTERVENTION
Debug "#PRINTER_STATUS_USER_INTERVENTION"
EndIf
If status & #PRINTER_STATUS_WAITING
Debug "#PRINTER_STATUS_WAITING"
EndIf
If status & #PRINTER_STATUS_WARMING_UP
Debug "#PRINTER_STATUS_WARMING_UP"
EndIf
Else
Debug Print_GetLastError()
;I always get the message: The data area passed to a system call is too small.
EndIf
Else
Debug Print_GetLastError()
EndIf