Re: Win32lib, bitmapped captions, David C.
- Posted by JJProg at CYBERBURY.NET
Sep 03, 1999
EU>I'd implemented a solution like Hendirk's before, but there's a reason I
EU>never posted it: it was buggy. Not in itself, but in conjunction with calls
EU>to Windows. For example:
EU> globalVariable = 123
EU> sendMessage( ... )
EU> ? globalVariable
EU>What value will be in globalVariable? You can't say, because sendMessage()
EU>causes an immediate callback to WndProc, and there's no guarantee what's
EU>been done to the global variable. I found this out the hard way tracking
EU>down some bugs in Llama. And virtually any Win32Lib routine is a wrapper
EU>around sendMessage(). This is why the getSelf() function is flakey.
EU>Comments?
EU>-- David Cuny
What if globalVariable was a sequence - like a stack. For example:
sequence returnStack
integer returnStackIndex
returnStackIndex = 0
returnStack = {}
global procedure setReturnValue(atom value)
returnStack[returnStackIndex] = value
end procedure
global procedue WndProc(...)
atom returnValue
...
returnStack &= 0
returnStackIndex += 1
call_proc(eventhandler,{...})
returnValue = returnStack[returnStackIndex]
returnStackIndex -= 1
returnStack = returnStack[1..length(returnStack)-1]
end procedure
Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/
|
Not Categorized, Please Help
|
|