On Sun, Jun 30, 2013 at 2:00 PM, Mark Miesfeld <miesf...@gmail.com> wrote:
>
> On Sun, Jun 30, 2013 at 1:41 PM, Art Heimsoth <artst...@artheimsoth.com>wrote:
>
>> Yes, I have the default working in my main program, and it has been
>> for awhile. I was wanting to get around the delay time by using an
>> Ok button to signal when the selection was what I wanted. I have
>> built a small test case that seems to want to work, but on the second
>> character input I get a 0x0005 (op code?) violation -not sure where
>> as I am not familiar with how to peruse that type of error.
>>
>
> Yikes that's a crash.
>
I don't get a crash, rather everything hangs. The reason is this:
::method OK
expose Fescue.
Fescue.Seller = 'A'
dlg = .SelectDialog~new("Test.rc", SELLER_DIALOG, , "Test.h")
dlg~parent = self
dlg~Fescue = Fescue.
dlg~sendMyData
dlg~Execute("SHOWTOP", IDI_DLG_OOREXX)
return 0
In OK() you start your second dialog. Then in your second dialog you have
this:
::method onChar unguarded
expose Fescue. lb findchar
use arg char
...
self~parent~logError(0,"Searching for" findchar)
return .false
In your first dialog you have for logError()
::method logError
expose Fescue.
use strict arg retrn, msg
...
What happens is, in your second dialog you type the first character.
onChar() starts executing and runs until it hits self~parent~logError()
logError() is unguarded. At this instant ok(), also unguarded, is
executing waiting for your second dialog to finish.
logError() can not run, so your onChar() method is blocked at that line.
The ok() method is waiting for your second dialog to end. So you have a
classic deadlock. Nothing can proceed.
In addition, in the window processing loop, the interpreter is waiting for
the reply from onChar(). So no more messages can be processed. As soon as
you type a second character or click on a button that message is sent to
the window by the operating system. At this point you are really hosed.
Your second dialog can not process any message, so it can not be closed.
The first dialog can not end until the second dialog is closed, and the
second dialog can not be closed. ;-)
The OS has a timer and sees that the application is not processing its
window messages. So, in Windows 7 at least, you get the 'Application is
not responding" dialog and you have to have the OS forcibly close the
application.
To fix that, you need to make either ok() or logError() unguarded.
Things shouldn't crash though. Is it on XP you see the crash?
--
Mark Miesfeld
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users