FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Crash on harbour TGet using FiveWin TGet
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 09:02 AM
Hello,
in our program we have a crash that I am not able to fix :-)
I created a little test that reproduce the problem:
Code (fw): Select all Collapse
#include <fivewin.ch>

proc main()
   LOCAL oDlg, oGet, xVal := 0, oBtn, cOther := "Other Get"
   DEFINE DIALOG oDlg
   @ 0,0 GET cOther
   @ 1,0 GET oGet VAR xVal  SIZE 100,20 PICTURE "@E 99.9999"
   @ 2,1 BUTTON oBtn ACTION SetText(oGet)
   ACTIVATE DIALOG oDlg ON INIT oGet:Refresh()
   
proc SetText(oGet)
   oGet:varPut("Prezzo offerta (PR_OFF)")
   oGet:Disable()
   oGet:Refresh()


Here the error.log:
Code (txt): Select all Collapse
<div id="{CB}" style="font-family: monospace;">Application
===========
   Path and name: C:\fwh32\samples\getError.exe (32 bits)
   Size: 3,623,424 bytes
   Compiler version: Harbour 3.2.0dev (r1711221033)
   FiveWin  version: FWH 17.11
   C compiler version: Microsoft Visual C++ 19.11.25508 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 1 secs 
   Error occurred at: 05/22/18, 11:01:22
   Error description: Error BASE/1073  Argument error: <
   Args:
     [   1] = C   Prezzo offerta (PR_OFF)
     [   2] = N   0

Stack Calls
===========
   Called from: ../../../tget.prg => TCLIPGET:PUTMASK( 0 )
   Called from: ../../../tget.prg => TCLIPGET:UPDATEBUFFER( 0 )
   Called from: .\source\classes\TGET.PRG => (b)TGET( 198 )
   Called from: .\source\classes\TGET.PRG => TGET:REFRESH( 0 )
   Called from: getError.prg => SETTEXT( 14 )
   Called from: getError.prg => (b)MAIN( 8 )
   Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK( 179 )
   Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1685 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
   Called from:  => SENDMESSAGE( 0 )
   Called from: dialog.prg => TDIALOG:COMMAND( 429 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: dialog.prg => TDIALOG:HANDLEEVENT( 925 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: dialog.prg => TDIALOG:ACTIVATE( 296 )
   Called from: getError.prg => MAIN( 9 )

System
======
   CPU type: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz 3592 Mhz
   Hardware memory: 12228 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 7
      1 ,                                                                                                     
      2 , C:\WINDOWS\System32\SHELL32.dll                                                                     
      3 , C:\WINDOWS\System32\shcore.dll                                                                      
      4 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.16299.431_none_d026bb 
      5 , C:\fwh32\samples\getError.exe                                                                       
      6 DDE Server Window, C:\WINDOWS\System32\ole32.dll                                                                       
      7 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.16299.431_none_8e5ffdab0274414 

Variables in use
================
   Procedure     Type   Value
   ==========================
   TCLIPGET:PUTMASK
     Param   1:    O    Class: ERROR
   TCLIPGET:UPDATEBUFFER
     Param   1:    C    "Prezzo offerta (PR_OFF)"
     Local   1:    L    .T.
     Local   2:    U    
     Local   3:    C    "zz/Pr/ o"
     Local   4:    C    "@E"
     Local   5:    C    "99.9999"
     Local   6:    U    
     Local   7:    S    
     Local   8:    O    Class: TCLIPGET
     Local   9:    C    "Prezzo offerta (PR_OFF)"
     Local  10:    N    0
     Local  11:    U    
     Local  12:    U    
   (b)TGET
     Local   1:    S    
     Local   2:    O    Class: TCLIPGET
   TGET:REFRESH
     Param   1:    O    Class: TGET
   SETTEXT
   (b)MAIN
     Param   1:    O    Class: TGET
   TBUTTON:CLICK
     Param   1:    O    Class: TBUTTON
   TBUTTON:HANDLEEVENT
   _FWH
     Param   1:    N    2048
     Param   2:    N    0
     Param   3:    N    0
     Local   1:    U    
   SENDMESSAGE
     Param   1:    N    0
     Param   2:    N    2048
     Param   3:    N    0
     Param   4:    N    0
     Param   5:    N    3
     Local   1:    O    Class: TBUTTON
   TDIALOG:COMMAND
     Param   1:    N    1052432
     Param   2:    N    2048
     Param   3:    N    0
     Param   4:    N    0
   TWINDOW:HANDLEEVENT
     Param   1:    N    103
     Param   2:    N    1052432
     Local   1:    O    Class: TBUTTON
     Local   2:    N    0
     Local   3:    N    103
     Local   4:    N    1052432
     Local   5:    U    
   TDIALOG:HANDLEEVENT
     Param   1:    N    273
     Param   2:    N    103
     Param   3:    N    1052432
   DIALOGBOXINDIRECT
     Param   1:    N    273
     Param   2:    N    103
     Param   3:    N    1052432
   TDIALOG:ACTIVATE
     Param   1:    N    14090240
     Param   2:    C    "€ È€         Ÿ L       € P        $  e E D I T   O t h e r   G e t       € P      
 d  f E D I T     0 , 0 0 0 0         P     $ +  g B U T T O N   & B u t t o n       "
     Param   3:    N    0
     Param   4:    O    Class: TDIALOG
   MAIN
     Param   1:    U    
     Param   2:    U    
     Param   3:    U    
     Param   4:    L    .F.
     Param   5:    U    
     Param   6:    L    .T.
     Param   7:    B    {|| ... }
     Param   8:    U    
     Param   9:    U    
     Param  10:    U    
     Param  11:    U    
     Local   1:    N    0
     Local   2:    S    
     Local   3:    O    Class: TDIALOG

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TWINDOW
     5 TDIALOG
     6 TBRUSH
     7 TCONTROL
     8 TGET
     9 GET
    10 TCLIPGET
    11 TBUTTON
    12 TFONT
    13 TREG32
    14 TRECT
    15 TSTRUCT

Memory Analysis
===============
      374 Static variables

   Dynamic memory consume:
      Actual  Value:     720896 bytes
      Highest Value:     720896 bytes
 </div>


Can someone help me?
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 09:32 AM
crach because you put on mask "@ 999.999.99" and then put this string "Prezzo offerta (PR_OFF)"
try to insert a number

sample :

oGet:varPut(10.000)

and not crash


Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 10:38 AM

The problem is that I need to put a string... In the main program this interface is used for comparing the value of a db column with another value, that can be a constante (a number by user input) or another column, in this case disable the get and show what column the program is comparing with.

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 12:11 PM

perhaps you can to use two gets on the same position.

Regards

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 01:34 PM
Code (fw): Select all Collapse
#include "fivewin.ch"

Function main()

   LOCAL oDlg, oGet, xVal := 0, oBtn, cOther := "Other Get"

   DEFINE DIALOG oDlg

   @ 0,0 GET cOther

   @ 1,0 GET oGet VAR xVal  SIZE 100,20 PICTURE "@E 99.9999"

   @ 2,1 BUTTON oBtn ACTION xSetText( xVal, oGet )

   ACTIVATE DIALOG oDlg ON INIT oGet:Refresh()

Return Nil
   
Function xSetText( xVal, oGet )


   xVal := Space(25)

   oGet:cPicture     := "@K Prezzo offerta (PR_OFF)"
   oGet:oGet:Picture := "@K Prezzo offerta (PR_OFF)"

   // oGet:varPut("Prezzo offerta (PR_OFF)")  // 23 c

   oGet:Disable()
   oGet:Refresh()

Return Nil


Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 03:08 PM
Stack Calls
===========
Called from: ../../../tget.prg => TCLIPGET:PUTMASK( 0 )
Called from: ../../../tget.prg => TCLIPGET:UPDATEBUFFER( 0 )

The error is with Harbour's Get. Not fivewin's TGet.
This is because Harbour's Get does not allow changing the type of variable during runtime.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Tue May 22, 2018 03:30 PM
This may be tried:
Code (fw): Select all Collapse
function testget()

   local oDlg, oGet
   local uVar  := 20

   DEFINE DIALOG oDlg SIZE 300,300 PIXEL TRUEPIXEL

   @  20, 20 GET oGet VAR uVar PICTURE "999,999.99" SIZE 200,24 PIXEL OF oDlg UPDATE

   @  60, 20 BUTTON "SHOW" SIZE 100,35 PIXEL OF oDlg ACTION MsgInfo( uVar )

   @  60,150 BUTTON "CHANGE" SIZE 100,35 PIXEL OF oDlg ACTION ( ;
      oGet:cPicture  := nil, ;
      uVar           := "This is some text          ", ;
      oGet:oGet      := FWGetNew( 0, 0, oGet:bSetGet, "uVar" ), ;
      oGet:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: Crash on harbour TGet using FiveWin TGet
Posted: Wed May 23, 2018 12:58 PM
Hello,
studying the harbour's TGet code, I arrived to this working code
Code (fw): Select all Collapse
proc SetText(oGet)
   oGet:cPicture := oGet:oGet:Picture := ""
   oGet:oGet:KillFocus()
   oGet:varPut("Prezzo offerta (PR_OFF)")
   oGet:Disable()
   oGet:Refresh()

Thank everyone for help,

Continue the discussion