Page 1 of 1

XBPPUSHBUTTON error after DCPRINT OFF

Posted: Fri Aug 12, 2016 7:25 am
by gradosic
Hi guys,

did anyone had problem with runtime error after print called "XBP-object has wrong state for access"... I have form with browse and button for printing invoices, and sometimes (without any pattern) after printig is complete i receive this error. I print without preview, only printer select dialog... Every time document is printed OK...

complete error:
Xbase++ version : Xbase++ (R) Version 2.00.575
Operating system : Windows Server 2012 R2 06.03 Build 09600
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: O CLASS: XbpPushButton
-> 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 : 8
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from XBPPUSHBUTTON:CREATE(1499)
Called from _CANCELDIALOG(928)
Called from (B)DC_PRINTER:INIT(889)


Thanks,

Re: XBPPUSHBUTTON error after DCPRINT OFF

Posted: Fri Aug 12, 2016 7:49 am
by rdonnay
The below code indicates that the error is caused when the Pushbutton on the Cancel dialog window is being created. The error makes no sense for two reasons:

1. The cancel dialog is created at the START of a print job, not the END.
2. I see nothing wrong with the code.

I suspect some memory corruption has occurred in your application.

That code should only be called if you are using the ENABLECANCEL clause of DCPRINT ON.
I recommend removing that clause.

Code: Select all

oXbp := XbpPushButton():new(oPrinter:oStatusDlg:drawingArea,,{10,10},{70,20},,.t.)
oXbp:caption := DC_LangMsg(DCMSG_CANCEL)
oXbp:activate := {||oPrinter:lTerminated := .t.}
oXbp:create()  <<<<<<<<<<<<<<<<<<<<  error caused by this line

Re: XBPPUSHBUTTON error after DCPRINT OFF

Posted: Fri Aug 12, 2016 8:26 am
by gradosic
Hi Roger,

OK, i will remove cancel option and try. Anyway no one use that.

Br,
Goran