Page 1 of 1

TPrinter:Preview() method

Posted: Sat Feb 18, 2006 4:43 pm
by Enrico Maria Giordano
Is it right that TPrinter:Preview() method

Code: Select all

METHOD Preview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
                               RPreview( Self ), ::End() )
calls ::End() if ::lMeta is .F.? If I'm not wrong, it seems that it calls ::End() a second time inside PrintEnd() function:

Code: Select all

FUNCTION PrintEnd()

     IF oPrinter:lMeta
          oPrinter:Preview()
     ELSE
          oPrinter:End()
     ENDIF

     oPrinter := nil

RETURN nil
EMG

Posted: Sun Feb 19, 2006 10:15 am
by Antonio Linares
Enrico,

Class TPrinter Method End() checks if ::hDC != nil so it should not be a problem to call it twice.

Posted: Sun Feb 19, 2006 11:19 am
by Enrico Maria Giordano
Yes, you are right. Sorry for the false alarm.

EMG