Error en xBrowse

Error en xBrowse

Postby horacio » Tue Mar 05, 2013 9:40 pm

He incorporado a mi proyecto la fuente de xBrowse y me tira este error

Code: Select all  Expand view

pplication
===========
   Path and name: C:\sipep_sql\SIPEP.EXE (32 bits)
   Size: 2,889,216 bytes
   Compiler version: Harbour 3.1.0dev (Rev. 17222)
   FiveWin  Version: FWH 12.04
   Windows version: 5.1, Build 2600 Service Pack 2

   Time from start: 0 hours 0 mins 4 secs
   Error occurred at: 06/03/2013, 18:23:05
   Error description: Error BASE/3101  Error de argumento: __OBJDERIVEDFROM

Stack Calls
===========
   Called from:  => __ERRRT_BASE( 0 )
   Called from: ../../../objfunc.prg => __OBJDERIVEDFROM( 0 )
   Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
   Called from: ../../../tobject.prg => NIL:ISKINDOF( 0 )
   Called from: C:\sipep_sql\xbrowse.prg => XBROWSENEW( 11864 )
   Called from: C:\sipep_sql\carga_conceptos.prg => INICIA( 108 )
   Called from: C:\sipep_sql\carga_conceptos.prg => CARGACONCEPTOS( 24 )
   Called from:  => (b)EVAL( 155 )
   Called from: .\source\function\MSGRUN.PRG => (b)MSGRUN( 36 )
   Called from: .\source\classes\DIALOG.PRG => (b)TDIALOG( 87 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:DISPLAY( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 873 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
   Called from: .\source\function\MSGRUN.PRG => MSGRUN( 42 )
   Called from: C:\sipep_sql\Sipep.prg => (b)EMPIEZA( 155 )
   Called from: C:\sipep_sql\btnbmp.prg => TBTNBMP:CLICK( 465 )
   Called from: C:\sipep_sql\btnbmp.prg => TBTNBMP:LBUTTONUP( 656 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
   Called from: C:\sipep_sql\btnbmp.prg => TBTNBMP:HANDLEEVENT( 1416 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 980 )
   Called from: C:\sipep_sql\Sipep.prg => EMPIEZA( 162 )
   Called from: C:\sipep_sql\Sipep.prg => MAIN( 16 )
 

Sin embargo si desmonto la clase del proyecto funciona perfectamente. Estoy compilando con FWH 12.04, Harbour 3.1 Rev. 17222, Bcc 5.82. ¿ Alguien sabe ? Gracias de antemano.

Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby nageswaragunupudi » Wed Mar 06, 2013 7:02 am

Please let us know if you have recompiled xbrowse.prg with flag /z ?

If not this error is impossible.

Explanation:
This error is because "NIL:isKindOf(...)" is called.
This is the program line in xbrowse:
Code: Select all  Expand view
  if oClass != nil .and. oClass:IsKindOf( 'TXBROWSE' )
 

In this line oClass:IsKindOf(...) is will be executed only if oClass is NIL and the xbrowse program is complied with flag /z.
FWH libraries are compiled without using the flag /z. So of oClass is nil, oClass:isKindOf is never executed.

In any case, can you also please post the part of your source code generating this error? (INICIA( 108 ))
Regards

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

Re: Error en xBrowse

Postby horacio » Wed Mar 06, 2013 11:38 am

Gracias por responder, aqui va el código, la linea INICIA( 108 )

Code: Select all  Expand view


        @ 56, 0 xBrowse oVarCarga : oBrwP Of oWndCarga Array oVarCarga : aPadron Columns 2 Size 299, oVarGlobales : oWndMain : nHeight - 200 Pixel Font oFont1                          NoBorder
        With Object oVarCarga : oBrwP
             :aCols[ 1 ] : bStrData      := { || OemToAnsi( oVarCarga : aPadron[ oVarCarga : oBrwP : nArrayAt ][ 2 ] ) }
             :aCols[ 1 ] : cHeader       := 'EMPLEADO'
             :aCols[ 1 ] : oHeaderFont   := oFont2
             :aCols[ 1 ] : nHeadStrAlign := 0
             :aCols[ 1 ] : lAllowSizing  := .f.
             :bChange          := { || BuscaLosLegajosDelEmpleado(), BuscaNetosYBrutos(), If( lEstoyEnTabla, oDlgConceptos : End(), )  }
             :nRowHeight       := 21
             :nHeaderHeight    := 25
             :lHScroll         := .f.
             :bKeyDown         := { | nKey | TeclaDelPadron( nKey ) }
             :nStretchCol      := STRETCHCOL_LAST
//         :bRClicked        := { | nRow, nCol | MenuSubEmpresa( nRow, nCol ) }
             PropiedadesBrowse( oVarCarga : oBrwP )
             :CreateFromCode()
             :oWnd : bKeyDown := { | nKey | If( nKey == VK_ESCAPE, oWndCarga : End(), ) }
        EndWith 

 
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby nageswaragunupudi » Wed Mar 06, 2013 11:58 am

These are the lines generating the error
These lines should not generate any error.

Code: Select all  Expand view
       @ 56, 0 xBrowse oVarCarga : oBrwP Of oWndCarga Array oVarCarga : aPadron Columns 2 Size 299, oVarGlobales : oWndMain : nHeight - 200 Pixel Font oFont1                          NoBorder
 


#1. Please make sure oWndCarga is a valid Window already declared.
You may test by inserting ? oWndCarga:ClassName() just before the xbrowse command.

#2. Please use the xbrowse as included in the FWH library.
In case you have separately compiled xbrowse.prg and included in your program, please remove that and test again.

#3. Please let us know if you use the switch /z ( or -z ) for compiling your prgs
Regards

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

Re: Error en xBrowse

Postby horacio » Sat Mar 09, 2013 3:12 pm

Gracias Mr Rao por su interés, disculpe mi demorada respuesta pero me fue imposible por razones laborales

#1. Please make sure oWndCarga is a valid Window already declared.
You may test by inserting ? oWndCarga:ClassName() just before the xbrowse command.


He probado su sugerencia y en los dos casos, tanto montando xBrowse en mi proyecto o usando la librería original de FWH oWndCarga es una ventana válida.

#2. Please use the xbrowse as included in the FWH library.
In case you have separately compiled xbrowse.prg and included in your program, please remove that and test again.


Como expresé en mi primer post, si incluyo la clase xBrowse en mi proyecto no funciona y genera el error descripto anteriormente, si utilízo la librería original funciona perfectamente

#3. Please let us know if you use the switch /z ( or -z ) for compiling your prgs


No utilizaba esta bandera pero al incluira nada a variado

Rao, Nuevamente gracias y espero me ayude a solucionar este problema
Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby horacio » Sat Mar 09, 2013 3:26 pm

Mr Rao, quiero aclararle que tengo otra aplicación compilada con xHarbour en cuyo proyecto incluyo la clase xBrowse y este error no se produce.

Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby horacio » Sat Mar 30, 2013 1:55 pm

He preparado un ejemplo sobre este tema. Ahora no tengo errores pero no me muestra el browse si lo tengo incorporado en el proyecto, si uso la que se encuentra en la librería funciona perfectamente.

Code: Select all  Expand view

#include "fivewin.ch"
#include "splitter.ch"
#include "ribbon.ch"
#include "xbrowse.ch"
#include "ado.ch"
Static oBrw

/*----------------------------------------------------------------------------*/
Function Main()

    DefineEntorno()
    DefineGlobales()
    CargaBases()
    Start()
    DbCloseAll()
    Return 0
   
/*----------------------------------------------------------------------------*/
Function Start()

    Memvar oVarGlobales
   
    Define Window oVarGlobales : oWndMain Mdi Menu MainMenu() Color 0, CLR_WHITE
       
        oVarGlobales : oWndMain : SetText( 'Cuatrocientos kilómetros de custodia' )       
   
    Activate Window oVarGlobales : oWndMain Maximized;
        On Init( PrimeraVentana() ) Valid( .t. )
   
    Return 0
   
/*----------------------------------------------------------------------------*/
Function DefineEntorno()

    Public oVarGlobales
   
    SetBalloon( .t. )
    Set Epoch To 1950
    Set Date  To British
    Set Delete   On
    Set Autopen  On
    Set Softseek On
    Set Century  On
    Set Confirm  On
    Set Optimize On
    Set Decimals To 2
    Set Fixed On
    Set Exact On
    Set Autoshare To 0
    SetGetColorFocus( Rgb( 220, 230, 250 ) )
    SetHandleCount( 150 )
    Request HB_LANG_ES
    Hb_LangSelect("ES")
    Request DBFCDX
    RddSetDefault( "DBFCDX" )
    SetDialogEsc( .t. )
    Return 0
       

/*----------------------------------------------------------------------------*/
Function DefineGlobales()   

    Memvar oVarGlobales
   
    With Object oVarGlobales := TPublic() : New()
    :Add( "cIni", CurDrive() + ":\" + CurDir() + "\plt.ini" )
       :Add( 'oWndMain' )
       :Add( 'oBar' )
    EndWith
    Return 0
   
/*----------------------------------------------------------------------------*/
Function CargaBases()

    Use ( 'c:\fwh\samples\customer.dbf' ) Via 'DBFCDX'
    Return 0


/*----------------------------------------------------------------------------*/
Function MainMenu   ()

    Local oMenu
   
    Menu oMenu
    EndMenu
    Return oMenu
   

/*----------------------------------------------------------------------------*/
Function PrimeraVentana()   

    Local oWnd
    Local oFont
    Local oFont1
    Local oFont2
    Memvar oVarGlobales
   
    Define Font oFont  Name "
Arial" Size 0, -10
   Define Font oFont1 Name "
Tahoma" Size 0, -9 Bold
   Define Font oFont2 Name 'Cooper Std' Size 0, -10 Bold

    Define Window oWnd MdiChild Of oVarGlobales : oWndMain Title "
Esta es la primera ventana"
   
        @ 01, 01 xBrowse oBrw Of oBrw Alias 'CUSTOMER' Pixel //Header 'codigo', 'alumno'
        oBrw : aCols := {}

      With Object oBrw : AddCol()
         :bStrData      := { || customer -> first }
         :nDataStrAlign := AL_CENTER
         :nHeadStrAlign := AL_LEFT
         :cHeader       := "
FIRST"
         :nWidth        := 80
         :oDataFont     := oFont
         :oHeaderFont   := oFont1
         :lAllowSizing  := .F.
      End
       
       
        With Object oBrw
            :CreateFromCode()
        End With
        oWnd : SetControl( oBrw )
   
    Activate Window oWnd Valid( oFont : End(), oFont1 : End(), oFont2 : End(), .t. )
    Return 0


Alguna idea ?
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby cnavarro » Sat Mar 30, 2013 6:34 pm

horacio wrote:He preparado un ejemplo sobre este tema. Ahora no tengo errores pero no me muestra el browse si lo tengo incorporado en el proyecto, si uso la que se encuentra en la librería funciona perfectamente.

Code: Select all  Expand view

#include "fivewin.ch"
#include "splitter.ch"
#include "ribbon.ch"
#include "xbrowse.ch"
#include "ado.ch"
Static oBrw

/*----------------------------------------------------------------------------*/
Function Main()

    DefineEntorno()
    DefineGlobales()
    CargaBases()
    Start()
    DbCloseAll()
    Return 0
   
/*----------------------------------------------------------------------------*/
Function Start()

    Memvar oVarGlobales
   
    Define Window oVarGlobales : oWndMain Mdi Menu MainMenu() Color 0, CLR_WHITE
       
        oVarGlobales : oWndMain : SetText( 'Cuatrocientos kilómetros de custodia' )       
   
    Activate Window oVarGlobales : oWndMain Maximized;
        On Init( PrimeraVentana() ) Valid( .t. )
   
    Return 0
   
/*----------------------------------------------------------------------------*/
Function DefineEntorno()

    Public oVarGlobales
   
    SetBalloon( .t. )
    Set Epoch To 1950
    Set Date  To British
    Set Delete   On
    Set Autopen  On
    Set Softseek On
    Set Century  On
    Set Confirm  On
    Set Optimize On
    Set Decimals To 2
    Set Fixed On
    Set Exact On
    Set Autoshare To 0
    SetGetColorFocus( Rgb( 220, 230, 250 ) )
    SetHandleCount( 150 )
    Request HB_LANG_ES
    Hb_LangSelect("ES")
    Request DBFCDX
    RddSetDefault( "DBFCDX" )
    SetDialogEsc( .t. )
    Return 0
       

/*----------------------------------------------------------------------------*/
Function DefineGlobales()   

    Memvar oVarGlobales
   
    With Object oVarGlobales := TPublic() : New()
    :Add( "cIni", CurDrive() + ":\" + CurDir() + "\plt.ini" )
       :Add( 'oWndMain' )
       :Add( 'oBar' )
    EndWith
    Return 0
   
/*----------------------------------------------------------------------------*/
Function CargaBases()

    Use ( 'c:\fwh\samples\customer.dbf' ) Via 'DBFCDX'
    Return 0


/*----------------------------------------------------------------------------*/
Function MainMenu   ()

    Local oMenu
   
    Menu oMenu
    EndMenu
    Return oMenu
   

/*----------------------------------------------------------------------------*/
Function PrimeraVentana()   

    Local oWnd
    Local oFont
    Local oFont1
    Local oFont2
    Memvar oVarGlobales
   
    Define Font oFont  Name "
Arial" Size 0, -10
   Define Font oFont1 Name "
Tahoma" Size 0, -9 Bold
   Define Font oFont2 Name 'Cooper Std' Size 0, -10 Bold

    Define Window oWnd MdiChild Of oVarGlobales : oWndMain Title "
Esta es la primera ventana"
   
        @ 01, 01 xBrowse oBrw Of oBrw Alias 'CUSTOMER' Pixel //Header 'codigo', 'alumno'
        oBrw : aCols := {}

      With Object oBrw : AddCol()
         :bStrData      := { || customer -> first }
         :nDataStrAlign := AL_CENTER
         :nHeadStrAlign := AL_LEFT
         :cHeader       := "
FIRST"
         :nWidth        := 80
         :oDataFont     := oFont
         :oHeaderFont   := oFont1
         :lAllowSizing  := .F.
      End
       
       
        With Object oBrw
            :CreateFromCode()
        End With
        oWnd : SetControl( oBrw )
   
    Activate Window oWnd Valid( oFont : End(), oFont1 : End(), oFont2 : End(), .t. )
    Return 0


Alguna idea ?


Hola
Yo hace algún tiempo tuve un problema muy parecido
Al añadir:
    @ 01, 01 xBrowse oBrw Of oBrw Alias 'CUSTOMER' Pixel //Header 'codigo', 'alumno'
oBrw:lRegistered := .F.
todo empezó a funcionar
No sé si tendrá algo que ver en tu caso.
Un saludo
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: Error en xBrowse

Postby horacio » Sat Mar 30, 2013 7:56 pm

Gracias Cristobal por responder, he probado tu sugerencia pero no hay caso. Lo que me extraña es que en otro proyecto con xHarbour, si agrego esta clase al proyecto funciona, no pasa lo mismo con Harbour. No hay manera, ya se me quemaron todas las tostadas :(

Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Error en xBrowse

Postby cnavarro » Sat Mar 30, 2013 8:11 pm

Horacio
No será esto: @ 01, 01 xBrowse oBrw Of oBrw Alias 'CUSTOMER' Pixel //Header 'codigo', 'alumno'
Un saludo
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: Error en xBrowse

Postby horacio » Sat Mar 30, 2013 8:23 pm

Cristobal, funcionó. :) , Muchas gracias por tu tiempo. lRegistered := .f. era la solución y tu observación era lo que no permitia que funcione ( un error grosero :oops: ). Gracias nuevamente !!!

Saludos
horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

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