actually it goes something like this
CharPtr foo;
foo=MemPtrNew(50);
result=MyCall(foo);
DoSomething(foo);
MemPtrFree(foo);
/-----------------------------/
int MyCall(CharPtr food) {
switch(MemPtrResize(food, 100)) {
case memErrChunkLocked
FrmCustomAlert(TestAlert, "fails here!!", " ", " ");
break;
}
}
-----Original Message-----
From: Roger Chaplin <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Wednesday, April 26, 2000 9:22 PM
Subject: Re: MemPtrResize
"Charles Rezsonya" <[EMAIL PROTECTED]> wrote:
> i am using memPtrResize, but it complained that the chunk isn't locked.
i
> look through the sdk doc, and it has a memPtrUnlock but no memPtrLock. i
> tried using memHandleLock but that right off the bat didn't work, so
before
> i jump into something that might not even work, can someone point me in
the
> right direction on how i should resize a ptr (charPtr).
Is your pointer really a pointer to a chunk, or is it just a pointer to
global or stack memory? That is,
char foo[SOMESIZE];
char *ptr = foo;
MemPtrResize(ptr, SOMEOTHERSIZE);
will not work. You can only resize a chunk that you've gotten with
MemHandleNew, MemPtrNew, DmNewHandle, or DmNewRecord.
--
Roger Chaplin
<[EMAIL PROTECTED]>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html