FB 4.2.0.305
I have a BCB6 project that I’m building. I have an icon file with 16, 256 and XP colors of various sizes. This works fine when I build via the IDE but when build through FB the brcc32 resource compiler is treating my 256 color icons in the icon file as XP colors and then Windows chooses the 256 color versions to display. I’m not sure what the IDE is doing to generate the .res file which works.
The MS resource compiler works so I want to use that instead of brcc32 but I cannot seem to get this to work with FB. I was using the Compile C++Builder Project action but tried switching to the “Compile Delphi Win32 Project” action which has an option to use compiler version C++Builder 6 but that fails with “Project1.bpr(1) Error: Declaration expected but ‘<’ found”…
I am customising the version info with a property set and some variables so I need to get FB to generate the RC file, call the MS RC.EXE to create the .RES then compile the project using that RES file.
Any info is greatly appreciated.
[By the application icon path/file in the .RC file generated by FB should escape backslashes as something like \trunk is treated as a tab character followed by “runk” by RC.EXE - I can work around it by hard-coding the path instead of using an existing variable]
Cheers,
Jarrod Hollingworth
Jarrod,
I’m not sure exactly why the delphi compiler won’t work, but it could be due to a different syntax. FinalBuilder does open and and modify a copy of the .dpr (and therefore must parse the file). Anyway, not sure on this one - maybe someone else might know why?
As for customising the resource compiler - FinalBuilder uses the System Variables BCB6_BRCC32 which are set at startup to point to the CBuilder resource compiler. What you could do is add a user or project variable with the same name and point it to a different resource compiler (this assumes that the command line parameters will be compatible).
What we need to do is to enhance the BCB action to allow using a different resource compiler… added to todo list.
.t8
Thanks Tate!
That set me on the right track. After checking the command line options I used the solution that you recommended - Created a project variable BCB6_BRCC32 and set it to the MS resource compiler:
C:\Program Files\Microsoft Platform SDK\bin\RC.EXE
The resource file is compiled correctly. The -fo and -v options used for BRCC32 work as a substitute for /fo and /v in RC.EXE.
BUT
Due to the use of a make file to build the BDB app the resource file is RE-COMPILED using the Borland resource compiler as the last lines in the make file are:
.rc.res:
$(BCB)\BIN$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $<
So I added some actions to rename the BRCC32.EXE, put in it’s place a renamed RC.Exe (and RcDll.Dll) and some later actions to restore it and that did the trick. I could probably suffice with only these actions (no setting of BCB6_BRCC32).
I should probably add some detection that the initial substitute has already been done in case the build fails half way and the rename is not undone.
Thanks Tate.
Cheers,
Jarrod
hehe… nice hack… but glad you got it sorted