Alaska Software Inc. - ::XbpBrowse:init(...)
Username: Password:
AuthorTopic: ::XbpBrowse:init(...)
Carlos Antonio Beling::XbpBrowse:init(...)
on Thu, 17 Mar 2022 11:09:05 -0300
Hi.
Good night.
I have a class derived from XbpBrowse().

In this line:
        ::XbpBrowse:init(::oDlg:drawingArea, ::oDlg:DrawingArea, {0, 0}, 
NIL, ::aPPColumns, .f.)

Even using ::XbpBrowse:init() (without parameters) I get the error below.
Can someone tell me what is wrong?

Fraternalmente
Beling


Xbase++ version     : Xbase++ (R) Version 2.00.1095
Operating system    : Windows 10 2009 Build 19043
------------------------------------------------------------------------------
oError:args         :
           -> VALTYPE: U VALUE: NIL
           -> VALTYPE: N VALUE: 355
oError:canDefault   : N
oError:canRetry     : N
oError:canSubstitute: Y
oError:cargo        : NIL
oError:description  : Parameter has a wrong data type
oError:filename     :
oError:genCode      :          2
oError:operation    : <NIL> > <355>
oError:osCode       :          0
oError:severity     :          2
oError:subCode      :          3
oError:subSystem    : BASE
oError:thread       :          1
oError:tries        :          0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from XBPBROWSE:INIT(457)
Called from CABBROWSE_:INIT(304)
Jim LeeRe: ::XbpBrowse:init(...)
on Fri, 18 Mar 2022 17:52:04 +0100
hi,

>  ::XbpBrowse:init(::oDlg:drawingArea, ::oDlg:DrawingArea, {0, 0},  NIL,
> ::aPPColumns, .f.)

normal a Method have Parameter which are pass to :Init() when use :new()




---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
Carlos Antonio BelingRe: ::XbpBrowse:init(...)
on Fri, 18 Mar 2022 18:06:18 -0300
Hi Jim.
Good night.
Many thanks.
Unfortunately I could not understanding what you said.
With or without parameters the program crashes.
May be who have the profissional subscription can to discover what is 
the cause of the error.

Fraternaly
Beling


Em 18/03/2022 13:52, Jim Lee escreveu:
> hi,
> 
>>   ::XbpBrowse:init(::oDlg:drawingArea, ::oDlg:DrawingArea, {0, 0},  NIL,
>> ::aPPColumns, .f.)
> 
> normal a Method have Parameter which are pass to :Init() when use :new()
> 
> 
> 
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
>
Jim LeeRe: ::XbpBrowse:init(...)
on Sat, 19 Mar 2022 19:17:07 +0100
hi,

you have ::oDlg "inside" your CLASS so how does your CLASS "FROM" look like
?
i guess you try to put "all" in 1 x CLASS but how do you "Init" it ?

---

"normal" you use
   oObj :=   XXX():new( oParent,oOwnder, aPos, aSize , aPresParam,lVisible)
   ...
   obj:Create()

CLASS XXX FROM Xb...
...
ENDCLASS

METHOD XXX:Init( oParent,oOwner,aPos,aSize,aPParam,lVisible )
...
return Self

METHOD XXX:Create( oParent,oOwner,aPos,aSize,aPParam,lVisible )
...
return Self



---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
Carlos Antonio BelingRe: ::XbpBrowse:init(...)
on Tue, 22 Mar 2022 15:37:17 -0300
Hi Jim.
Good day.
Many thanks.
I think that Andreas posted the solution of the problem.
In time: the Ivar ::oDlg was defined as READONLY. May be that is the 
problem too.

Fraternally
Beling


Em 19/03/2022 15:17, Jim Lee escreveu:
> hi,
> 
> you have ::oDlg "inside" your CLASS so how does your CLASS "FROM" look like
> ?
> i guess you try to put "all" in 1 x CLASS but how do you "Init" it ?
> 
> ---
> 
> "normal" you use
>     oObj :=   XXX():new( oParent,oOwnder, aPos, aSize , aPresParam,lVisible)
>     ...
>     obj:Create()
> 
> CLASS XXX FROM Xb...
> ...
> ENDCLASS
> 
> METHOD XXX:Init( oParent,oOwner,aPos,aSize,aPParam,lVisible )
> ...
> return Self
> 
> METHOD XXX:Create( oParent,oOwner,aPos,aSize,aPParam,lVisible )
> ...
> return Self
> 
> 
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
>
Andreas Gehrs-Pahl
Re: ::XbpBrowse:init(...)
on Sun, 20 Mar 2022 17:45:22 -0400
Carlos,

>oError:operation    : <NIL> > <355>
>Called from XBPBROWSE:INIT(457)

This is a test if the XbpBrowse:nBehavior Class Variable is greater than the 
constant XBPBRW_BEHAVIOR_1X. In your case, the XbpBrowse:nBehavior Class 
Variable is NIL. This means that your XbpBrowse:nBehavior Class Variable 
hasn't been initialized. It should be set to XBPBRW_BEHAVIOR_DEFAULT in the 
XbpBrowse Class Method XbpBrowse:InitClass(), but that method apparently 
hasn't been called (yet).

I don't know why it hasn't been called automatically, but a simple solution 
would be to add an InitClass() method to your derived class and call the 
XbpBrowse:InitClass() from there:

Class YourClass from XbpBrowse

Exported:
Class Method InitClass

EndClass

Class Method YourClass:InitClass() 
   ::XbpBrowse:InitClass()
return (Self)

Another possibility is that you have implemented an Instance (or Class) 
variable named :nBehavior in your derived class that interferes with the 
XbpBrowse's behavior (pun intended).

Hope that helps.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Carlos Antonio BelingRe: ::XbpBrowse:init(...)
on Tue, 22 Mar 2022 15:39:04 -0300
Hi Andreas.
Good day.
Many thanks again.
Really the subclass did not call the Super class method. I will to do this.

Fraternally
Beling

Em 20/03/2022 18:45, Andreas Gehrs-Pahl escreveu:
> Carlos,
> 
>> oError:operation    : <NIL> > <355>
>> Called from XBPBROWSE:INIT(457)
> 
> This is a test if the XbpBrowse:nBehavior Class Variable is greater than the
> constant XBPBRW_BEHAVIOR_1X. In your case, the XbpBrowse:nBehavior Class
> Variable is NIL. This means that your XbpBrowse:nBehavior Class Variable
> hasn't been initialized. It should be set to XBPBRW_BEHAVIOR_DEFAULT in the
> XbpBrowse Class Method XbpBrowse:InitClass(), but that method apparently
> hasn't been called (yet).
> 
> I don't know why it hasn't been called automatically, but a simple solution
> would be to add an InitClass() method to your derived class and call the
> XbpBrowse:InitClass() from there:
> 
> Class YourClass from XbpBrowse
> 
> Exported:
> Class Method InitClass
> 
> EndClass
> 
> Class Method YourClass:InitClass()
>     ::XbpBrowse:InitClass()
> return (Self)
> 
> Another possibility is that you have implemented an Instance (or Class)
> variable named :nBehavior in your derived class that interferes with the
> XbpBrowse's behavior (pun intended).
> 
> Hope that helps.
> 
> Andreas