[futurebasic] Re: [FB] CALL PLOTCICON

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Brian Stevens<brilor@...>
Date: Sun, 31 Oct 1999 21:53:59 -0700
>>Friends,
>>
>>I'm using the following code to extract a cicn from a resource file
>>and plot it but what gets plotted is just a bunch of junk. If I use
>>GETCICON to extract the icon from the app's resources this works
>>fine. CALLing DETACHRESOURCE on the iconH& doesn't change anything I
>>must be missing some magic somewhere. Can anyone clue me in?
>>
>>   priorResFile% = FN CURRESFILE
>>   resFileID% = FN OPENRFPERM(filename$, vRefNum%, _fsRdPerm)
>>   CALL USERESFILE(resFileID%)
>>   DEFSTR LONG
>>   iconH& = FN GET1RESOURCE(_"cicn", 128)
>>   DEFSTR WORD
>>   CALL CLOSERESFILE(resFileID%)
>>   CALL USERESFILE(priorResFile%)
>>   LONG IF iconH&
>>     WINDOW 1,"Icon Calls",(0,0)-(32,32),_docNoGrow
>>     CALL SETRECT(theRect, 0, 0, 32, 32)
>>     CALL PLOTCICON(theRect, iconH&)
>>   END IF
>>
Charlie,

As I recall the CLOSERESFILE is going to remove it from the resource list,
deallocate the space occupied by the resource map AND deallocate any of the
file's resouces that might have been read into memory (as you are trying to
do).  Try moving the close and use resfile down after the Long if.

HTH---Brian

>
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>