On Nov 3, 2006, at 9:31 PM, Rubber Chicken Software Co. wrote:
At 03:28 PM 11/2/2006, you wrote:
> The problem is that the RB app does not receive any of these
> messages until the function returns; after it returns they just
> collapse in all at once.
What makes you believe that this is the case?
It's an assumption, but I don't really know another way to find
out. Even if I did find out, I don't know what to do about it.
If your callback function is updating the UI somehow, more likely
is that the window
simply isn't redrawing until the dylib function returns.
Any advice on how to get the StaticText and Progress Bar to redraw,
if the callbacks are coming in/completing before the function
returns? A DoEvents call?
Or, any advice on how to get the callbacks to come in before the
function returns, if that is the case?
(BTW, I did try call the function in a separate thread, but that
crashes RB; Christian MonkeyBread said it was because RB isn't
thread-safe.)
As a usual VB user, all this seems funny to me in this day of age.
VB seems very pre-emptive multi-tasking, whereas RB seems more like
16-Windows, where one thing MUST come after the other.
Not so. I think the problem here is that REALbasic uses cooperative
threads, and your dylib cannot cooperate with Rb. If you wrote the
library, then it would be possible to reimplement it so that it could
cooperate with Rb by breaking long tasks into a sequence of shorter
tasks that could be called from Rb in a loop, thus allowing the
runtime the opportunity to switch context.
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>