From: "Michael Sealand" <[EMAIL PROTECTED]>
>      For some reason, this code keeps crashing on the DmResizeResource
>
> static void SaveInfo(CharPtr theString)
>

> VoidHand InfoHand;
>  CharPtr InfoStr;
> InfoHand = DmGet1Resource('tSTR', 1000);
> ErrFatalDisplayIf(InfoHand == NULL, "Could not find the resource.");
>
> InfoHand = DmResizeResource(InfoHand, StrLen(theString) * sizeof(Char));
> ErrFatalDisplayIf(InfoHand == NULL, "Could not resize resource.");
> etc.

The docs say DmResizeResource can fail if
1) the resource wasn't found
2) the database containing the resource is in read-only mode
3) the record chunk is locked

#2 or #3 might be happening here.  Why not check DmGetLastErr to see what it
is?
Also, shouldn't you resize the resource to at least StrLen(theString)+1 ?



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to