TPrinter:Preview() method

Post Reply
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

TPrinter:Preview() method

Post by Enrico Maria Giordano »

Is it right that TPrinter:Preview() method

Code: Select all | Expand

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 | Expand

FUNCTION PrintEnd()

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

     oPrinter := nil

RETURN nil


EMG
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Enrico,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Post by Enrico Maria Giordano »

Yes, you are right. Sorry for the false alarm.

EMG
Post Reply