Menu

#113 Sometimes hcedit() crashes

v1.0_(example)
open
nobody
None
1
2023-05-15
2022-09-26
No

Hi, I have this function :

//------------------------
function translate(cprog)
//------------------------
INIT DIALOG oDlg1 CLIPPER NOEXIT TITLE cTitle AT oMainWindow:nLeft+140,oMainWindow:nTop+130  SIZE 940,352 FONT oFont

 @  10,30  say cProg SIZE 220, 22 BACKCOLOR hwg_ColorC2N("#83E4CA") COLOR hwg_ColorC2N("0000FF") TOOLTIP cTooltip01

 @  10,60  SAY _("English comment") SIZE 200, 20 COLOR hwg_ColorC2N("FF0000") TOOLTIP cTooltip02
 @  10,80  HCEDIT oComment_EN SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
oComment_EN:SetText(cComment_EN,,,,)

@ 480,60  SAY _("French comment") SIZE 200, 20 COLOR hwg_ColorC2N("FF0000") TOOLTIP cTooltip02
@ 480,80  HCEDIT oComment_FR SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
oComment_FR:SetText(cComment_FR,,,,)

@ 10,150  SAY _("English info") SIZE 200, 20 COLOR hwg_ColorC2N("FF0000") TOOLTIP cTooltip03
@ 10,170  HCEDIT oInfo_EN SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
oInfo_EN:SetText(cInfo_EN,,,,)

@ 480,150 SAY _("French info") SIZE 200, 20 COLOR hwg_ColorC2N("FF0000") TOOLTIP cTooltip03
@ 480,170 HCEDIT oInfo_FR SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
oInfo_FR:SetText(cInfo_FR,,,,)

@ 350,300 BUTTON _("Save") OF oDlg1 ID IDOK  ;
SIZE 100, 32 COLOR hwg_ColorC2N("FF0000")
@ 470,300 BUTTON _("Cancel") OF oDlg1 ID IDCANCEL  ;
SIZE 100, 32 COLOR hwg_ColorC2N("FF0000")

ACTIVATE DIALOG oDlg1

After a few of copy/paste, I have sometimes a crash like this :

Daté du 26/09/22 09:05:17
---------------------------------------------
Error BASE/3012  Argument error: HB_UTF8STUFF
Called from HB_UTF8STUFF(0)
Called from HCED_STUFF(2764)
Called from HCEDIT:INSTEXT(2050)
Called from HCEDIT:ONKEYDOWN(1516)
Called from HCEDIT:ONEVENT(526)
Called from HWG_ACTIVATEDIALOG(0)
Called from HDIALOG:ACTIVATE(183)
Called from TRANSLATE(488)
Called from APPLICATIONS(430)
Called from (b)MAIN(903)
Called from HOWNBUTTON:MUP(329)
Called from HOWNBUTTON:ONEVENT(152)
Called from HWG_ACTIVATEMAINWINDOW(0)
Called from HMAINWINDOW:ACTIVATE(351)
Called from MAIN(2386)

I dont know if it's due to the zone where I click to enter in an hcedit function (in the texte or in a zone which is in hcedit but out of the text, but it crashes (program is not closed, and I must kill it)
I don't know, but it seems due to hcedit ...

I have also sometimes another type of crash with this function, but in this case, it closes my program, and it is very talkative in a console. I will send it when it will come again.

Thanks
A+

1 Attachments

Discussion

  • Wilfried Brunken

    Good morning Alain,
    for saving time please can you complete your sample,
    so that it runs with alone with the appended hbp file ?

    With regards,
    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2023-05-11

    Hi Wilfried,

    I have retrieved this old ticket.

    I have build Ticket113.prg using the hbp.
    It builds, but crashes when running.

    Error BASE/1004  No exported method: SETTEXT
    Called from SETTEXT(0)
    Called from TRANSLATE(77)
    Called from (b)MAIN(24)
    Called from HBUTTON:ONEVENT(453)
    Called from HWG_ACTIVATEMAINWINDOW(0)
    Called from HMAINWINDOW:ACTIVATE(360)
    Called from MAIN(26)
    

    If I comment this line, it crashes no more ...

    I don't find any reason.

    A+

     
  • Wilfried Brunken

    Hello Alain,
    the objects oComment_xx , cInfo_xx are not created.
    So i look for this ticket the next few days.

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     
  • Aupeix Alain

    Aupeix Alain - 2023-05-13

    Hi Wilfried,

    There were a typo in line 77 of Test113.prg ???

    @ 10,170  HCEDIT oComment_FR SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
    oInfo_EN:SetText(cInfo_EN,,,,)
    

    instead of :

    @ 10,170  HCEDIT oInfo_EN SIZE 450, 60 BACKCOLOR hwg_ColorC2N("FFFFFF") COLOR hwg_ColorC2N("000000")
    oInfo_EN:SetText(cInfo_EN,,,,)
    

    which was the reason of :

    Error BASE/1004  No exported method: SETTEXT
    Called from SETTEXT(0)
    Called from TRANSLATE(78)
    Called from (b)MAIN(24)
    Called from HBUTTON:ONEVENT(453)
    Called from HWG_ACTIVATEMAINWINDOW(0)
    Called from HMAINWINDOW:ACTIVATE(360)ginal 
    Called from MAIN(26)
    

    Probably because oInfo_EN was NIL ...

    But I must retest the original crash, because I don't remember the problem ...

    Thanks
    A+

     
  • Wilfried Brunken

    Hello Alain,
    with commit r3225 i added the corected sample program
    in the "test" directory, please check.

    Be shure, that the object names are corresponding:
    (for example)

    HCEDIT oComment_FR ... && ==> object created, so after this the methods can be called
    oComment_FR:SetText(cInfo_FR,,,,)

    I appended the screenshot made on Windows 11,
    but of corse i done a test on LINUX.

    With regards

    MNI TNX, 73 es 55 de
    DF7BE, Wilfried

     

Log in to post a comment.