The whole objective seems wrong! It will save a 4 byte pointer inside a memory area, and you could just save that into the feature directly, so on the surface you are gaining nothing.

So what is "pit" really trying to achieve?

MemHandleLock returns a pointer to the memory area, which can be cast to Char*

        Char *ptr = MemHandleLock (myAppPrefs.it);
        ...
        ...     //  read/write to the memory using the pointer
        ...
        // to resize the memory area
        MemHandleUnlock (myAppPrefs.it);
        if (MemHandleResize (myAppPrefs.it, newSize) == errNone)
                ptr = MemHandleLock (myAppPrefs.it);
        else ptr = NULL;
        ...
        if (ptr != NULL) MemHandleUnlock (myAppPrefs.it);

Subject: Re: Problem with MemHandleResize - memErrChunkLocked
From: "Chris Apers" <[EMAIL PROTECTED]>
Date: Tue, 20 Apr 2004 14:09:54 +0200

You store your char** in the handle using MemHandleLock
Each time you need to read/write access the data you use
MemHandleLock/Unlock.

Create a new handle :
MemHandle myH = MemHandleNew(...);
myAppPrefs.it = myH;

Then you want to write your char** :
char **myCharPP = MemHandleLock(myAppPrefs.it);
myCharPP = ...; // or whatever you want
MemHandleUnlock(myAppPrefs.it);

If you want to read it :
char **myCharPP = MemHandleLock(myAppPrefs.it);
char **readPP = myCharPP; // or whatever you want
MemHandleUnlock(myAppPrefs.it);


----- Original Message ----- From: "Pit" <[EMAIL PROTECTED]> Sent: Tuesday, April 20, 2004 1:04 PM Subject: Re: Problem with MemHandleResize - memErrChunkLocked


> OK, but what is really obscour to me is, how can i save my char** into > this handle!

Roger Stringer Marietta Systems, Inc. (www.mariettasystems.com)


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

Reply via email to