The problem was my PC and not the compiler or my code.  I restarted my
computer and the same code compiled and ran without a hitch.

D

-----Original Message-----
From: Mike Pellegrino <[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Wednesday, March 24, 1999 11:47 PM
Subject: RE: Bad Pointers


>Dave,
>
>Your pointer is a pointer to a Char.  You're returning a pointer to a
>pointer to a Char.  So, your function signature needs to be as follows:
>
> 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;
> }
>
>Cheers,
>
>Mike
>
>
>> -----Original Message-----
>> From: Dave Lippincott [SMTP:[EMAIL PROTECTED]]
>> Sent: Wednesday, March 24, 1999 11:06 AM
>> To: [EMAIL PROTECTED]
>> Subject: Bad Pointers
>>
>> 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