I am trying to print to a printer other than the windows default printer - in vista.
The technique used works fine in xp and before - however in vista - the Message Stop dialog appears as follows:
There are no printers installed!
Please exit this application and install a printer.
This message is coming from the TPRINTERS:NEW method
- and, in this particular scenario, there are several printers installed.
The following is the call to the Tprinter:new Method:
ODEVICE := TPRINTER():NEW( 'Report Name', .F., NIL, PRINTERNAME )
where PRINTERNAME is the name of the printer to use as acquired from the PRINTERSETUP() function as follows:
PRINTERSETUP()
hDC := GetPrintDefault( GetActiveWindow() )
PRINTERNAME := PRNGETNAME()
If, however in the vista environment,
I call Tprinter:new with the 2cnd parameter to force the printer selection dialog - all seems to work fine.
ODEVICE := TPRINTER():NEW( 'Report Name', .T.)
This is undesireable due to the additional interaction (Printer selection dialog) with the user which should not be required,
as we know what printer to use.
Any help with this issue is GREATLY appreciated.