realbasic-nug
[Top] [All Lists]

problem with KeyDown event and Valentina

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: problem with KeyDown event and Valentina
From: Charles Yeomans <charles at declareSub dot com>
Date: Fri, 30 Dec 2005 19:11:52 -0500
Cc: Ruslan Zasukhin <sunshine at public dot kherson dot ua>
Delivered-to: realbasic-nug at lists dot realsoftware dot com
I'm seeing a curious problem in the interaction of a KeyDown event handler and Valentina. I have an EditField that holds a date. When the date is changed, I retrieve some data from the database and load it into a Listbox. The + and - minus keys increment and decrement the date, and so trigger the database search.

The immediate problem is that when I type several + or - quickly, my application crashes silently. Vigorous logging shows that a call is made to Valentina's SQLSelect function before the previous one has returned, which I suspect is causing Valentina to crash. This happens because the EditField.KeyDown event handler is being called in response to a key press before the previous KeyDown event handler has exited; the log data suggests that REALbasic is calling the next KeyDown while Valentina is in the middle of its SQLSelect call.

I wonder how this can happen. I guess that somehow a cycle of the event loop is occurring while Valentina is executing an SQLSelect ot something; I am most perplexed. This only occurs when connecting to a remote database; I don't know if Valentina is just so much faster locally that no timing problem occurs, or if there is something more fundamentally different.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>