>Hi
>I try to use Printstatus but it's always returns true (.T.) if the printer is connected through the Windows Control Panel.
>
>Is it fix in Vfp 7 ?
>
There's no 'fix' - it's a Windows environment issue. You don't have direct access to a printer port; the print device may be local or remote; you talk to the spooler. You can access the status of a print port via a device monitor, but you don't have the capability of writing one in just VFP; you have to write (or obtain a third-party library or control that has the necessary hooks into the port monitors) something in a much lower-level language such as C
>And how can i chek if the printer is online before sending my report ?
Not trivially; your best bet is to get a third-party control that can do this for you.
>I'am tring to use Getprinter in win32api, is there some one knowing how to declare it ?
>
DECLARE INTEGER GetPrinter IN SPOOLSS.DLL ;
STRING @ pDevice, ;
INTEGER dwLevel, ;
STRING @ pPrinter, ;
INTEGER cbBuf, ;
INTEGER @ pcbNeeded
You want to retrieve a PRINTER_INFO_2 structure (2nd argument to the call is a 2), and will need to construct a buffer of appropriate size. You'll also need to parse the PRINTER_INFO_2 structure; you might want to check Christof Lange's STRUCT class to see if he has that supported. Handling the call is not trivial if you have toi parse the structure yourself, and IAC, if the device isn't local, you won't necessarily be able to determine its state. Do yourself a favor and buy an ActiveX control; you might want to check
www.componentsource.com or Hallogram to see if there's one that's known to be VFP compatible that meets your needs.