I guess I'll go ahead and reply to my own message:

I changed the Handle LENGTH to 1300 and it crashed after only a couple 
records.  Then I added MemHandleFree(myHandle) and I went through the whole 
list about 8 times and it hasn't crashed yet.

Now, all my code that has to do with that Handle looks like:

     MemHandle  myHandle = MemHandleNew(1300);
     Char       *myText  = MemHandleLock(myHandle);

     ...string operations...

     MemHandleUnlock(myHandle);
     MemHandleFree(myHandle);

Is there anything else I need to free or anything before my function ends.

I actually went through a tutorial a month ago and never saw the use of 
MemHandleFree().  It only took about 50 pages of code and prob'ly a few 
hundred calls to MemHandleNew for it to finally cause it to crash.

If anyone notices anything I am missing or perhaps thinks this was a fluke, 
your comments would be appreciated.

Thanks,
Scott






>Hey Guys,
>
>I've been getting that nasty "Invalid Handle"  error message for a couple
>hours now.  I have properly locked and unlocked every MemHandle and have
>released the db records each time as well.
>
>What I found was, in my call
>
>     myHandle = MemHandleNew(LENGTH);
>     myText   = MemHandleLock(myHandle);
>
>the bigger I make "LENGTH", the more it crashes.  Originally I had it set 
>at
>135, but when I took it down to 45, it crashed about half as much.  I'm
>pretty sure this isn't due to other intervention.
>
>The crash happens when I am viewing my records.  I have nine records, and
>all I do is view each record over and over again (that's all) and 
>eventually
>after seeing each one 3 or 4 times, it'll crash on a random record and
>always on the line of code shown above.
>
>IS THERE A MAX that I should use?  Or is my problem something else?
>
>Any help would be greatly appreciated,
>Scott
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
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