EXCESS RELEASE OF FONT

Re: EXCESS RELEASE OF FONT ( solucionado )

Postby mastintin » Mon Jan 19, 2015 9:51 pm

mas aún si dejo la linea así:

REDEFINE GET aObj[vNOMCLI] VAR aVAr[vNOMCLI] ID IDNOMCLI OF oDlg PICTURE "@!" // FONT ofont2 UPDATE

no da error .

REDEFINE GET aObj[vNOMCLI] VAR aVAr[vNOMCLI] ID IDNOMCLI OF oDlg PICTURE "@!" FONT ofont2 UPDATE
asi si da error .

Creo que el problema va a estar en la clase get que se enlaza que no sera la de fwh y no estará actualizada....

------------ edito -------------
Listo solucionado ... estaba enlazada una clase get que no estaba actualizada.
Queda pendiente de completar la signacion de fonts en el define de tdatepick .
yo creo que el código correcto seria el propuesto por cristobal :


if oFont = nil
::SetFont( oWnd:oFont )
else
::SetFont( oFont )
endif

Gracias a todos por la ayuda .
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: EXCESS RELEASE OF FONT

Postby cnavarro » Tue Jan 20, 2015 3:03 pm

Manuel, tambien habria que valorar esto que he visto en algun control

Code: Select all  Expand view

   ::SetFont( oFont )
   if ::oFont == nil
      ::oFont := TFont():New()
      ::oFont:hFont := GetStockObject( DEFAULT_GUI_FONT )
   endif
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Mon Jan 26, 2015 8:41 pm

En el foro en inglés he añadido este error que me ha generado un report con la version de FW 15.1:

Code: Select all  Expand view
Select all  Expand view
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
         <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21041) <-FCONT_PRN(13823)
        ------------------------------------------------------------  
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21041) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------  
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21041) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------  
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
         <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21044) <-FCONT_PRN(13823)
        ------------------------------------------------------------  
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21044) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------  
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21044) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------  
 


En la línea 1412 de c:\fwh\source\classes\report.prg viene:
Code: Select all  Expand view
ASend( ::aFont, "End" )
 


¿Qué se debe de hacer con esa línea?.
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby Antonio Linares » Tue Jan 27, 2015 6:15 am

Paz,

Esa línea es correcta.

Lo que cuenta es que todas las asignaciones de fonts que tengas en tu aplicacion usen oObjeto:SetFont( oFont )
regards, saludos

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

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Tue Feb 03, 2015 11:52 am

Sigue saltanto el error. Son llamadas que hace TREPORT:

Code: Select all  Expand view
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21060) <-ALBA_PRN(10677)
    ------------------------------------------------------------   
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TPRINTER:END(435) <-TREPORT:END(1405) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175) <-TBUTTON:HANDLEEVENT(1687) <-_FWH(3450)
    ------------------------------------------------------------   
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------   
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------   
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21060) <-ALBA_PRN(10677)
    ------------------------------------------------------------   
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------   
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------   
 
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Wed Feb 04, 2015 8:59 am

Este es el código con el que da esos mensajes de error. No encuentro donde puede estar el fallo:

function informe(cCaption,cTitulo1,cTitulo2,cCabecera1,cCabecera2,;
aContenido,aPicture,aEncabezado,aAnchura,aTotaliza,;
bTextoSubgr,campoSubgr,nLtrSize,lPreview,lPrinterSetup)
local oRpt
local oFontNorm, oFontNegr
local oPen1, oPen2
local i:=0

local cImpresoraSalida:=""

default cTitulo1 TO ''
default cTitulo2 TO ''
default cCaption TO cTitulo1
default cCabecera1 TO ''
default cCabecera2 TO ''
default campoSubgr TO ''
default campoSubgr TO ''
default lPreview TO .T.
default lPrinterSetup TO .T.

// Selecciona la impresora.
if lPrinterSetup
msginfo('SE VA A IMPRIMIR: '+cTitulo1,'IMPRIMIR')
cImpresoraSalida:=SeleccionaPrn()
if len(cImpresoraSalida) == 0
return NIL
endif
else
cImpresoraSalida:=PrnGetName()
endif

// Genera el informe.

if .not. empty(nLtrSize)
DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-nLtrSize
DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-nLtrSize BOLD
DEFINE PEN oPen1 WIDTH 1
DEFINE PEN oPen2 WIDTH 3
else
DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-10
DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-10 BOLD
DEFINE PEN oPen1 WIDTH 2
DEFINE PEN oPen2 WIDTH 5
endif

oRpt := RptBegin({{|| cTitulo1},{|| cTitulo2}},;
{{|| cCabecera1},{|| cCabecera2}},;
{{|| "Pg."+str(oRpt:nPage,3)}},;
{oFontNorm, oFontNegr}, {oPen1, oPen2},,cImpresoraSalida,,;
, lPreview,,, cCaption,;
'CENTER' , 'LEFT', 'RIGHT' )

for i=1 TO len( aContenido )
oRpt:AddColumn(TRcolumn():new({aEncabezado[i]},,;
{aContenido[i] },,;
{HacePicture(aPicture[i],aAnchura[i])},,;
iif(aTotaliza[i]='N',.f.,.t.);
,,,,,,oRpt))
next i
if len(campoSubgr)>0
GROUP ON &(campoSubgr) ;
HEADER eval(bTextoSubgr); //HEADER CTextoSubgr+': '+oRpt:aGroups[1]:cValue;
FONT 2 // EJECT Si se quiere que salte de página en cada group.
endif

END REPORT
sysrefresh()

ACTIVATE REPORT oRpt
GO TOP
//oFontNorm:end()
//oFontNegr:end()
oPen1:end()
oPen2:end()
oRpt:end()
sysrefresh()
return NIL
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Wed Feb 04, 2015 9:00 am

Pongo el código que genera donde se genera el error en un formato más legible:

Code: Select all  Expand view
function informe(cCaption,cTitulo1,cTitulo2,cCabecera1,cCabecera2,;
                 aContenido,aPicture,aEncabezado,aAnchura,aTotaliza,;
                 bTextoSubgr,campoSubgr,nLtrSize,lPreview,lPrinterSetup)
 local oRpt
 local oFontNorm, oFontNegr
 local oPen1, oPen2
 local i:=0
 
 local cImpresoraSalida:=""
 
 default cTitulo1   TO ''
 default cTitulo2   TO ''
 default cCaption   TO cTitulo1
 default cCabecera1 TO ''
 default cCabecera2 TO ''
 default campoSubgr TO ''
 default campoSubgr TO ''
 default lPreview   TO .T.
 default lPrinterSetup TO .T.
   
 // Selecciona la impresora.
 if lPrinterSetup
   msginfo('SE VA A IMPRIMIR: '+cTitulo1,'IMPRIMIR')
   cImpresoraSalida:=SeleccionaPrn()
   if len(cImpresoraSalida) == 0
     return NIL
   endif
  else
    cImpresoraSalida:=PrnGetName()
 endif
 
 // Genera el informe.
 
 if .not. empty(nLtrSize)
    DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-nLtrSize
    DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-nLtrSize BOLD
    DEFINE PEN oPen1 WIDTH 1
    DEFINE PEN oPen2 WIDTH 3
   else
    DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-10
    DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-10 BOLD
    DEFINE PEN oPen1 WIDTH 2
    DEFINE PEN oPen2 WIDTH 5
 endif
 
 oRpt :=  RptBegin({{|| cTitulo1},{|| cTitulo2}},;
                   {{|| cCabecera1},{|| cCabecera2}},;
                   {{|| "Pg."+str(oRpt:nPage,3)}},;
                   {oFontNorm, oFontNegr}, {oPen1, oPen2},,cImpresoraSalida,,;
                   , lPreview,,, cCaption,;
                   'CENTER' , 'LEFT', 'RIGHT' )
   
    for i=1 TO len( aContenido )
      oRpt:AddColumn(TRcolumn():new({aEncabezado[i]},,;
                                    {aContenido[i] },,;
                                    {HacePicture(aPicture[i],aAnchura[i])},,;
                                    iif(aTotaliza[i]='N',.f.,.t.);
                                    ,,,,,,oRpt))
    next i
    if len(campoSubgr)>0
      GROUP ON &(campoSubgr) ;
            HEADER eval(bTextoSubgr); //HEADER CTextoSubgr+': '+oRpt:aGroups[1]:cValue;
            FONT 2  // EJECT  Si se quiere que salte de página en cada group.
    endif        

 END REPORT
 sysrefresh()
 
 ACTIVATE REPORT oRpt
 GO TOP
 //oFontNorm:end()
 //oFontNegr:end()
 oPen1:end()
 oPen2:end()
 oRpt:end()
 sysrefresh()
return NIL
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby lucasdebeltran » Wed Feb 04, 2015 9:49 am

Hola,

Después del ACTIVATE REPORT, tienes que finalizar las fonts locales de esa función:

oFontNorm:end()
oFontNegr:end()

¿Por qué lo has comentado?. Prueba y verás como funciona OK.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: EXCESS RELEASE OF FONT

Postby nageswaragunupudi » Wed Feb 04, 2015 11:46 am

Mr Verhoven

We shall test the second program you posted and get back to you.

Hope you are using FWH without any changes or additions.

I am asking this because if you include "fivewin.ch", the following lines give syntax error:
default cTitulo1 TO ''
default cTitulo2 TO ''
default cCaption TO cTitulo1
default cCabecera1 TO ''
default cCabecera2 TO ''
default campoSubgr TO ''
default campoSubgr TO ''
default lPreview TO .T.
default lPrinterSetup TO .T.

You can not compile the above program with FWH
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10326
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Wed Feb 04, 2015 12:47 pm

The program compiles OK with fivewin.ch and with all these default ...
We use FWH without any addition or change.
At the begining of prg we use:

Code: Select all  Expand view
#include 'inkey.ch'
#include 'set.ch'
#include 'report.ch'
#include 'fivewin.ch'
#include 'rddsys.ch'      
#include "common.ch"
#include "DLL.ch"
#include 'ord.ch'                                    //Para CDX
#include 'Image.ch'
#include "fileio.ch"
 
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby lucasdebeltran » Wed Feb 04, 2015 1:15 pm

Hello,

Have you tried to put this lines?

Code: Select all  Expand view
oFontNorm:end()
oFontNegr:end()
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Wed Feb 04, 2015 4:20 pm

El problema persiste:

Code: Select all  Expand view
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21065) <-FCONT_PRN(13826)
    ------------------------------------------------------------   
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21065) <-FCONT_PRN(13826) <-(b)FCONT_EDIT(13647) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------   
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21065) <-FCONT_PRN(13826) <-(b)FCONT_EDIT(13647) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: EXCESS RELEASE OF FONT

Postby nageswaragunupudi » Wed Feb 04, 2015 5:56 pm

Mr Verhoven

Please see part of the code:
Code: Select all  Expand view
oPen1:end()
 oPen2:end()
 oRpt:end()  // DELETE THIS LINE
 


Please delete line oRpt:End().
oRpt:End() was already called by ACTIVATE command inside Activate() method.
Your code oRpt:End() is a second call releasing the font second time extra.

And restore these lines by uncommenting:
Code: Select all  Expand view
oFontNorm:end()  // required
 oFontNegr:end()  // required
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10326
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: EXCESS RELEASE OF FONT

Postby Verhoven » Wed Feb 04, 2015 7:57 pm

Solved Mr. Nageswaragunupudi, thanks a lot. :D
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

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