>Well I did this... so I have to wait 2 weeks to get the answer to this one?

Not at all.  Try using a debugger; if you're running one when you cause the
problem then you can look at a stack trace and find out what you're
calling, and thereby figure out what's going wrong.

Basic debugging techniques apply: step through your code, set breakpoints,
look at the values of parameters you're passing.  If these are concepts
you're not familiar with, you really should consider taking a good C
course, since otherwise we could get you over this hump but you'd just hit
another one in an hour.  Debugging isn't PalmOS-specific thing.

There are times that the debugging messages aren't clear and so having the
OS source helps greatly, but when one says "Invalid Parameter" then you
should check the parameters you're passing in to the function which is
complaining, since odds are high that one or more of them is invalid :-)

"Chunk under-locked" means you're calling unlock on a handle that isn't
locked.  With the debugger you'll probably find easily which line of your
code is trying to call MemHandleUnlock (or MemPtrUnlock) to unlock
something that isn't locked.  Or calling a routine which does the same.

Caveat - if something has corrupted the heap, you could get these sorts of
things going haywire for other reasons.  Again, use standard C techniques
to debug trashing memory, plus use latest versions of the Palm OS Emulator
to help you debug it, in combination with your normal debugger.

-David Fedor
Palm Developer Support

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

Reply via email to