[futurebasic] Creating IconFamilyResource Handle (thread name adjustment)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2005 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 25 Oct 2005 01:01:21 -0400
Waverly wrote:

>Sorry, I forgot to tell you, this completely untested.
>I just typed this in based on what I saw on screen and online.
>
>
>>W.
>
>begin record IconFamilyElement
>dim elementType as OSType
>dim elementSize as Size
>dim elementData(1) as unsigned char
>end record
>
>begin record IconFamilyResource
>dim resourceType as OSType
>dim resourceSize as Size
>dim elements(1) as IconFamilyElement
>end record
>
>local fn NewIconFamilyHandle
>dim as handle icns
>//dim icns as handle to IconFamilyResource
>
>icns = fn NewHandle( 8 )
>long if ( icns )
>icns.resourceType = _IconFamilyType
>icns.resourceSize = 8
>end if
>end fn = icns


Thanks, Wave, but still getting the same "can't use handle as a 
pointer" error. My apologies for posting to the wrong thread and for 
the copy/paste icnsH stupid last-minute, change-for the-list mistake 
caught by tedd (not in my original code.)

Oh well, will keep trying. I have built a prototype of a utility some 
of you might like, but it is now becoming victim to "creeping 
featureitis" of my own making.

Ken

-----Original Message-----

>Does anyone know how this C function should be translated into FB
>
>
>IconFamilyHandle NewIconFamilyHandle()
>{
>      IconFamilyHandle    icns = (IconFamilyHandle) NewHandle( 8 );
>
>      if ( icns )
>      {
>          ( **icns ).resourceType = kIconFamilyType;
>          ( **icns ).resourceSize = 8;
>      }
>
>      return icns;
>}
>
>
>My FB translation fails:
>
>
>local fn NewIconFamilyHandle
>
>dim as IconFamilyHandle    icnsH
>
>icns = fn NewHandle( 8 )
>long if ( icnsH )
>      (icnsH..nil ).resourceType = _kIconFamilyType
>      (icnsH..nil ).resourceSize = 8
>end if
>
>end fn = icnsH
>
>
>Ken