FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with TPrinter class
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem with TPrinter class
Posted: Thu May 31, 2007 06: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 :

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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
Problem with TPrinter class
Posted: Thu May 31, 2007 07:33 PM

probably a pageend() is executed twice

Frank

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Problem with TPrinter class
Posted: Thu May 31, 2007 07:55 PM

Look for a duplicated ENDPAGE

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem with TPrinter class
Posted: Thu May 31, 2007 08: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion