[futurebasic] Push button cicn in ext res file

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

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 8 Mar 2005 10:09:26 -0500
Bernie asked:

I have two resource files, the application resource "app.rsrc" and an
external resource "ext.rsrc". Both files contain an identically
numbered but different resource (ID: 1001). The following code builds a
window with two controls, an icon push button and an icon control, and
both need to display the cicn contained in the external res file. The
icon control shows the correct cicn (the one in ext.rsrc) but the push
button displays the one in app.rsrc

Can anyone show me what I'm doing wrong here?



Bernie,

When you open your external resource file, be sure you point FB to it:


long if fn FSMakeFSSpec(system(_aplVRefNum), system(_aplParID), 
"ext.rsrc", fs) == _noErr

// Point to the resource file you want to use
resources "ext.rsrc"

extRes = fn FSpOpenResFile(fs, _fsRdWrPerm)
if extRes <> -1 then UseResFile(extRes)
end if


Take a look at the Reference manual under Resources for hints about 
how to avoid conflicts with identically named resources in different 
files.


Ken