I have a problem printing reports on my notebook with Vista. I get the message "There are no printers installed. Please exit this ...".
In fact I have printers installed and there is also a default printer defined.
I found the reason for this error is in these lines in printer.prg
- Code: Select all Expand view
- .....
elseif cModel == nil
::hDC := GetPrintDefault( GetActiveWindow() )
if ::hDC != 0
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
endif
.....
if ::hDC != 0
aOffset = PrnOffset( ::hDC )
::nXOffset = aOffset[ 1 ]
::nYOffset = aOffset[ 2 ]
::nOrient = ::GetOrientation()
elseif ComDlgXErr() != 0 // PDERR_NODEFAULTPRN = 0x1008 (4104)
MsgStop( "There are no printers installed!" + CRLF + ;
"Please exit this application and install a printer." )
::nXOffset = 0
::nYOffset = 0
....
::lUser is .f., I don´t open a common dialog box
ComDlgXErr() returns 4104 (PDERR_NODEFAULTPRN), although GetPrintDefault() returns a correct handle and GetModel() returns the correct printer name of the default printer.
Why does ComDlgXErr() return an error code ?
Does anyone noticed this behavior ?