I have a strange problem with a menu/form accessing unallocated memory. 
Here is the scenario:

- Form loads OK, menu works OK, menu option can switch to another form with 
FrmGotoForm, and come back with FrmGotoForm OK.
- On original form I do some stuff, CtlSetUsable, SclSetScrollBar, 
FrmSetObjectBounds, then a FrmEraseForm and FrmDrawForm. All seems OK.
- I can go to the menu, but when an option is selected, I get about 10 
warnings that unallocated memory is being accessed.

The same happens if I don't do any menu stuff first (line 1 above).

Here is the stack trace of the first access:

AppEventLoop
SysEventGet
WinSetDrawWindow
WinSetDrawWindow
WinValidateHandle

Other traces end with:

WinWindowToDisplayPt

I have found out that if I remove the FrmEraseForm the problem goes away, 
which is lucky because I have realised that I don't actually need the 
FrmEraseForm.

However, I find this kind of scary as I cannot see anything that I am doing 
that would be "dodgy". The docs don't indicate anything to me that I 
shouldn't do a FrmEraseForm then a FrmDrawForm (except that FrmDrawForm 
does an erase in >3.5 OS).

Anyone have any comments on stuff going on in the background of forms that 
would lead to this sort of thing? (I haven't tried to extract a minimal 
amount of code that duplicates the problem.)

Matt


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

Reply via email to