Hi
I'm having a problem passing a pointer between functions.  I have a function
that takes a Handle and CharPtr.  The function locks the handle and returns
the pointer to the string but the CharPtr always returns as NULL (even
though the chunk was locked properly).  Is this a problem with CodeWarrior
(R5) or am I doing this the wrong way?

Thanks
Dave

<sample code>
CharPtr Buffer;
Handle MemHandle;
.
.
.
MemHandle = MemHandleNew(size+1);
FunctionX(MemHandle,Buffer);
// At this point Buffer is NULL - Why?
.
.
.

UInt FunctionX(Handle Source,CharPtr Result)
{
// do stuff that doesn't impact result or source

Result = MemHandleLock(Source);
// Result is the correct value here

return retval;
}


Reply via email to