Problem with TPrinter class

Problem with TPrinter class

Postby driessen » Thu May 31, 2007 6:06 pm

Hello,

I have made a report using the TPRINTER class with PREVIEW.

Just before the preview is shown, the following error is dsplayes :

Error (6) deleting enhanced metafile

Error description


I put MsgInfo() in the PRINTER.PRG and I found out that the error occurs in the next procedure :

Code: Select all  Expand view
METHOD _EndPage() CLASS TPrinter

   if ::hDC = 0
      return nil
   endif

   if ::lMeta
      if Len( ::aMeta ) == 0
         MsgAlert( "The temporal metafile could not be created",;
                   "Printer object Error" )
      else
       #ifndef __CLIPPER__
       
*         In the next line, the error occurs !!!

          DeleteEnhMetaFile( CloseEnhMetaFile( ::hDCOut ) )

       #ELSE
           DeleteMetaFile( CloseMetaFile( ::hDCOut ) )
       #ENDIF

         if ! File( Atail( ::aMeta ) )
           MsgAlert("Could not create temporary file: "+Atail(::aMeta)+CRLF+CRLF+;
             "Please check your free space on your hard drive "+CRLF+;
             "and the amount of files handles available." ,;
             "Print preview error" )
         endif
      endif
   else
      EndPage( ::hDC )
   endif

return nil


Does anyone know what the reason is for this problem ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby demont frank » Thu May 31, 2007 7:33 pm

probably a pageend() is executed twice

Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby Antonio Linares » Thu May 31, 2007 7:55 pm

Look for a duplicated ENDPAGE
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby driessen » Thu May 31, 2007 8:39 pm

Thank you very much, guys.

Indeed I used ENDPAGE twice.

Problem solved.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 50 guests