Page 1 of 1

wrong state for access

Posted: Wed Feb 22, 2017 9:00 am
by Cliff Wiernik
I get this error occassionally, but not reproducible where even though express checks for this prior to calling the xbpdialog:create() method, it will generate this error. Discussions with Alaska tech support indicates the issue may be that the application is in the process of changing the program or dialog when the user is in the middle of opening a new dialog and it is causing a thread mismatch.

I though I had would be to disable the main application window when the new dialog is being built until it is completed and the event loop is started. However, I am trying to determine what is the reference to that and if I could disable it having the desired effect.

Cliff

Code: Select all

ERROR OBJECT:
------------------------------------------------------------------------------
oError:args         :
          -> VALTYPE: O CLASS: DC_XbpDialog1
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: U VALUE: NIL
oError:canDefault   : N
oError:canRetry     : N
oError:canSubstitute: Y
oError:cargo        : NIL
oError:description  : XBP-object has wrong state for access
oError:filename     : 
oError:genCode      :        104
oError:operation    : :Create
oError:osCode       :          0
oError:severity     :          2
oError:subCode      :       4208
oError:subSystem    : BASE
oError:thread       :          5
oError:tries        :          0
DAC last message    : 
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from XBPDIALOG:CREATE(573)
Called from DC_XBPDIALOG1:CREATE(12861)
Called from DC_GETLIST:INIT(855)
Called from DC_READGUI(110)
Called from SIMPLMST(4694)
Called from _GUIRUN(199)
Called from (B)GUIRUN(148)

Re: wrong state for access

Posted: Thu Feb 23, 2017 6:57 am
by rdonnay
I don't know why this is happening to you.
I haven't heard other reports of this.
Here is a change to DC_XbpDialog1:create() method that will display an error message and then break out to give the user another chance to create the window rather than crashing.

Code: Select all

METHOD DC_XbpDialog1:create( a, b, c, d, e, f )

IF ::XbpDialog:Status() = XBP_STAT_INIT
  ::XbpDialog:create( a,b,c,d,e,f )
  IF !::XbpDialog:Status() = XBP_STAT_CREATE
    DC_WinAlert('Unable to create Dialog Window')
    BREAK
  ENDIF
ELSE
  DC_WinAlert('Unable to initilize Dialog Window')
  BREAK
ENDIF

::nYTitlebarheight := GetTitleBarHeight( self )

RETURN self

Re: wrong state for access

Posted: Thu Feb 23, 2017 8:07 am
by Cliff Wiernik
I will look at this.