[futurebasic] Re: [FB] Getting rsrc from user file

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

From: Alain PASTOR <apastor@...>
Date: Tue, 09 Oct 2001 00:01:01 +0200
I wrote:
> 
> why don't you use the more modern call fn FSOpenResFile?

I meant, FSpOpenResFile. Here is a code that might work:

LOCAL FN getFCOD
  DIM Size&,OSErr%,Temp$,gCodeH&
  DIM filetype$,oldRes%,appRes%
  DIM fSpec AS FSSpec
//gFBAutoXrefUseTempMem = _zTrue 
  fileType = "APPL"
  Temp$ = "Select a built FB application."
  fSpec.parID = 0
  fSpec.name = FILES$(_fOpen,Filetype,Temp$,fSpec.vRefNum)
  LONG IF fSpec.name[0]
    oldRes  = FN CurResFile
    appRes% = fn FSpOpenResFile(fSpec,_fsRdWrPerm)
    UseResFile(appRes)
    gCodeH& = fn GetIndResource(_"FCOD",1)
    UseResFile(oldRes)
    DetachResource(gCodeH&)
    CloseResFile(appRes%)
  END IF
END FN


-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------