At 10:22 AM 10/31/2004, you wrote:
I have a form that has two sets of controls on that are hidden or shown (FrmShowObject, FrmHideObject) depending on the state of a pair of grouped pushbuttons. When one of these in particular is pressed, my handler switches the objects' states, then updates the now unhidden table and scrollbar. The form displays correctly at this point. If the next thing that the user does is to press the page-dn button, my handler scrolls the table contents and updates the scroll bar. But the first call that I make to a function that will affect a control, such as SclSetScrollBar, the POSE emulator with M505 debug ROM reports an error reading from 0x80000020, which it says can be caused by calling a "Window Mgr function without first establishing a valid Draw Window".

What is really strange is that if, instead of using the key, I tap in the scrollbar area to page it down (which goes through the same code in my app), it works OK. And once it has scrolled, the page-up/down keys now work OK with no errors. It is only the first time after switching to that form state that the error occurs, and only in response to a key press as opposed to a tap on a control.

Any ideas what to look for?

What is called immediately before the call to SclSetScrollBar? Since SclSetScrollBar will redraw the bar if it's moved, it touches the drawing window, and that error means that there is no valid drawing window. Try adding a call to WinGetDrawWindow immediately before this call and see if it's NULL. If so, the problem lies before the SclSetScrollBar call. You're looking for anything that might be invalidating the draw window.



-- Ben Combee, Technical Lead, Developer Services, PalmSource, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Developer Fourm Archives: http://news.palmos.com/read/all_forums/



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to