EASYREPORT
if a user exit printer select dialog without selecting a printer
oPrn:hDC is zero and your program crashes completely.
I inserted following lines to check for hDC.
Maybe there is a way to build in a standard error handling for that.
Best regards,
Otto
oVRD.prg
after:
::oPrn := PrintBegin( ::cTitle,, ::lPreview, ;
IIF( EMPTY( ::cPrinter ), NIL, ::cPrinter ), ;
IIF( ::lPreview, lModal, .F. ) )
insert:
//kein Drucker gefunden
if ::oPrn:hDC = 0
RETURN ( Self )
Endif
in my program:
EASYREPORT oVRD NAME ".\xVrd\kabrg.vrd" ;
PREVIEW lPreview TO cPrnName OF oWnd PRINTDIALOG IIF( lPreview, .F., .F. )
if oVRD:oPRN:hDC = 0
oVRD:end()
? "kein Drucker verfügbar"
return nil
endif