Page 3 of 4

Re: Error in DCBrowse

Posted: Fri Sep 10, 2021 4:21 am
by Tom
Hi, Wolfgang.

I'm trying to find it. If LbClick was created very fast and repeatly, a parameter in HandleEvent was missing its second part. We just placed a simple IF there, as I remember, but I'm not sure.

Re: Error in DCBrowse

Posted: Fri Sep 10, 2021 6:59 am
by rdonnay
If LbClick was created very fast and repeatly, a parameter in HandleEvent was missing its second part. We just placed a simple IF there, as I remember, but I'm not sure
The workaround could be put into a custom handler, but I don't like that as a solution.

Alternatively, the error could be trapped in the eXpress++ main handler: DC_GETLIST:EVENTLOOP(4784)

A third option would be to make the change to xbp-browse.prg (Alaska's source) and add that file to the DCLIPX_20.XPJ project file.

Let's talk about this before we move forward.

Re: Error in DCBrowse

Posted: Fri Sep 10, 2021 7:52 am
by Wolfgang Ciriack
Hello Roger,
because i only get this error in one of many used DCBROWSEs in my app, i would first like to put this workaround in a custom handler.
The one i use for this DCBROWSE looks so:

Code: Select all

Static Function My_BrwHandler(nEvent, mp1, mp2, oXbp, GetList, oDialog, aRef)
LOCAL oMBrw := aRef[1], oS := aRef[2]

   Unused(GetList) ; Unused(oDialog),  Unused(oXbp)
    if nEvent == xbeP_Keyboard
       if SetAppFocus() == oMBrw
          if mp1 >= 32 .and. mp1 < 165
             SetAppFocus(oS)
             PostAppEvent(xbeP_Keyboard, mp1, mp2, oS)
          endif
       endif
    endif
return (DCGUI_NONE)
So what i have to add here to see, if this can avoid this error ?

Re: Error in DCBrowse

Posted: Fri Sep 10, 2021 8:58 am
by rdonnay
The error shows that :gotoItem is comparing an array to a numeric, therefore the error.

It is still not clear to me that this is a secondary error, caused by a failure of lbClick.
I want to hear from Tom first about what he finds in his code.

Re: Error in DCBrowse

Posted: Fri Sep 10, 2021 9:46 am
by skiman
Hi,

Code: Select all

 (::NavigationMode == XBPBRW_NAVIGATION_1XCOMPATIBLE .OR.;
  AScan(::aRecNo, ::RowPhyPos) == nRow)    <-------------row 2411
Since ascan always returns a numeric, it must be ::NavigationMode that is sometimes an array. The errorlog points to line 2411, but this is because 2410 and 2411 are one line of code.

Re: Error in DCBrowse

Posted: Fri Sep 17, 2021 11:00 am
by Wolfgang Ciriack
Hello Chris,
Since ascan always returns a numeric, it must be ::NavigationMode that is sometimes an array.
I think, here you are wrong. I think it is the comparison of

Code: Select all

lIsMarked := (nRow == ::nRowPos) .and. ..... 
I have analysed the events which are generated of the DCBrowse.
Why i do get xbeBRW_ItemMarked events with different parameters ??
There are some with f.e.

Code: Select all

xbeBRW_ItemMarked    mp1:3               mp2:1
xbeBRW_ItemMarked    mp1:{1, 1}          mp2:NIL
For me it is not clear, which events i have to check in my handler for right parameters.
xbeM_LbDown, xbeM_LbClick or xbeBRW_ItemMarked ?

Re: Error in DCBrowse

Posted: Mon Sep 20, 2021 5:07 am
by Wolfgang Ciriack
Hello Roger,
Tom do not find his "workaround", but see in his error logs, that he get these errors, too.
So can you please have a look at my previous post ?
Thank you.

Re: Error in DCBrowse

Posted: Mon Sep 20, 2021 7:16 am
by Tom
As Wolfgang mentioned - I can't find it. The problem is caused by several LbClick/LbDblClick/LbDown on a browse created fast after another. Sometimes, the HandleEvent() calling XbpBrowse:GotoItem misses its second parameter. This happens if the method called after GotoItem takes some time, i.e. something is done on the cell contens. If the users click fast while this happens, the second parameter sometimes get lost.

Re: Error in DCBrowse

Posted: Thu Sep 23, 2021 9:55 pm
by Wolfgang Ciriack
Hello Roger,
can you please take a look at this topic ?

Re: Error in DCBrowse

Posted: Fri Sep 24, 2021 7:43 am
by rdonnay
Hello Roger,
can you please take a look at this topic ?
Ok, I'll get on it today.