On Tue, May 14, 2013 at 2:54 AM, Oliver Sims <
oliver.s...@simsassociates.co.uk> wrote:

> **
>
> I should have said - the problem is in ViewMixin.rex - there I have an
> init method with a forward class (super) continue.
>  Re-naming the method and deleting the "forward" instruction fixed the
> problem.
> The init method is unnecessary in the mixin - it was left in by mistake
> when modifying what was a true superclass into a mixin.
>

Hi Oliver,

Internally the ooDialog framework uses data structures in the native C /
C++ code to manage things.

Basically what you were doing by naming that method init() was interjecting
your code into middle of the object initialization chain and disrupting the
correct initialization of the DynamicDialog.  This in turn caused the data
structures to be incorrectly set up.

Due to the size difference of pointers on 32-bit and 64-bit systems, this
produced different results.  On my 64-bit system, it resulted in a bad
window handle, which was detected when you attempted to show the
CustomerView dialog, and handled by raising an error condition.  On a
32-bit system it resulted in a bad pointer which crashed the interpreter.

I've added code to detect if the initialization of the DynamicDialog is
skipped and running your program, as it was, would now produce:

CustomerView after .Application.
OrderMgrView-showModel-01: className = CustomerListModel
ObjectMgr-showModel-01a - modelNames: CustomerListModel a
ObjectMgr-showModel-01a - modelNames: CustomerModel CU0003
CustomerView-init-01.
ViewMixin-initViewMixin-01.
  8323 *-* forward class (super) arguments (newArgs) continue
   128 *-* forward class (super) continue
   112 *-* dlg = .CustomerView~new("Customer\CustomerView.rc",
"IDD_CUST_DIALOG")
   218 *-*   viewId = msg~send
   214 *-*       objectMgr~showModel("CustomerModel", info~text, rootDlg)
            -- Ex07
   195 *-* self~showCustomer
Error 98 running
C:\work.ooRexx\wc\ooDialog\trunk\examples\userGuide\exercises\Exercise08\Customer\CustomerView.re
x line 112:  Execution error
Error 98.900:  The UserDialog base class has not been initialized
correctly; DynamicDialog initialization has been
 skipped
OrderMgrView-cancel-01: response to ask dialog = 1
EventMgr-triggerEvent-01: event = appClosing
OrderMgrView-cancel: triggerEvent response = 0


So, this is good.  No interpreter crash.


> I've committed the fixed version.
>


You could have fixed your problem by doing this instead of what you had
done.

You had:

::method init
--  ::METHOD initViewMixin
expose objectMgr
say "ViewMixin-initViewMixin-01."
forward class (super) continue -- BAD - REMOVE ASAP
objectMgr = .local~my.ObjectMgr -- Needed to clear up when dialog closed.
self~viewMgr = .local~myViewMgr
return

should have been:

::method init
--  ::METHOD initViewMixin
expose objectMgr
say "ViewMixin-initViewMixin-01."
forward class (super) continue
*ret = result*
objectMgr = .local~my.ObjectMgr -- Needed to clear up when dialog closed.
self~viewMgr = .local~myViewMgr
*return ret*

If you are going to interject yourself into the middle of the
initialization chain, you would need to take care that you don't break the
chain.

I would advise that you not interject yourself into the middle of the
initialization chain unless you understand the implications and really need
to.

Since you don't really need to in this case, your committed fix is the best
option.

--
Mark Miesfeld
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to