Page 1 of 1

EndPage en TPrinter

PostPosted: Mon Mar 27, 2006 8:47 am
by fgondi
Hola foro,

He encontrado el siguiente problema en la clase TPrinter.

El método EndPage contiene lo siguiente:
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__
        ::hDCOut := DeleteEnhMetaFile( CloseEnhMetaFile( ::hDCOut ) )
       #else
         ::hDCOut := 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 )   // Esta función no exite
   endif

return nil

En el aparece la llamada "EndPage( ::hDC )", la cual es una función que no existe.

PostPosted: Mon Mar 27, 2006 9:26 am
by Antonio Linares
Fernando,

La función EndPage() está en source\winapi\printdc.c

PostPosted: Mon Mar 27, 2006 11:49 am
by fgondi
Hola Antonio,

Perdón, tienes toda la razón.

Me esta dando un error, de vez en cuando, porque no existe endpage y no logro localizarlo.

Seguiré buscando donde tengo el problema.

PostPosted: Mon Apr 03, 2006 9:01 am
by fgondi
Hola,

Sigo a vueltas con el error y no consigo localizarlo

Alguno sabe porque se produce este error?

Code: Select all  Expand view
   Error BASE/1.004  Mensaje sin definir: ENDPAGE
   Argumentos: Llamadas al Stack
_______________________________________________________________________________
   Called from ENDPAGE(0)
   Called from PAGEEND(0)
   Called from TPRN:SETPRINT(1057)
   Called from TPRN:SETPRINT(1075)
   Called from TGBUSQ:REPORT(770)
   Called from (b)TGBUSQ:BUILDCONTROLS(449)
   Called from TBTNBMP:CLICK(0)
   Called from TBTNBMP:LBUTTONUP(0)
   Called from TWINDOW:HANDLEEVENT(0)
   Called from TBTNBMP:HANDLEEVENT(1349)
   Called from _FWH(3136)
   Called from WINRUN(0)
   Called from TMDIFRAME:ACTIVATE(882)
   Called from MAIN(62)


Gracias por vuestro tiempo

PostPosted: Mon Apr 03, 2006 9:10 am
by Antonio Linares
Fernando,

Estás usando un errorsys modificado. Por favor haz que muestre la clase del objeto que está recibiendo ese mensaje. Gracias.

O usa el errorsys de FWH, que te lo indicará, y luego cambia al tuyo.

PostPosted: Mon Apr 03, 2006 10:31 am
by fgondi
Hola Antonio,

Ya he dado con el problema. Estaba llamando a ENDPAGE sin haber llamado antes a PAGE

Gracias por tu tiempo y perdona por hacertelo perder en una bobada.

PostPosted: Mon Apr 03, 2006 11:59 am
by Antonio Linares
Fernando,

mejor que sea una bobada que algo más dificil :)

todos nos equivocamos. Somos humanos...