Page 1 of 2

.RC dialogs and images limit!?

PostPosted: Thu Sep 25, 2008 2:39 pm
by JC
Dear Antonio and friends,

Exists a limit of number the dialogs and images into a .RC file?

PostPosted: Thu Sep 25, 2008 3:01 pm
by hag
JC:

I have an rc with almost 600 "includes"...And have hit a limit.

PostPosted: Thu Sep 25, 2008 3:12 pm
by JC
hag wrote:JC:

I have an rc with almost 600 "includes"...And have hit a limit.


Harvey,

How I can get the BCC556?

PostPosted: Thu Sep 25, 2008 4:20 pm
by Antonio Linares
Julio,

Whats the size of your RES file ? It can't be larger than 1024 Ks.

If larger, then you have to split your RC into several ones and have several RES files

PostPosted: Thu Sep 25, 2008 4:23 pm
by driessen
Antonio,

I don't agree that a RES-file may not exceed 1024 KB.

In my application, I have a RES file which is bigger than 1300 KB and everything is working fine.

PostPosted: Thu Sep 25, 2008 4:26 pm
by Antonio Linares
Michel,

yes, you may be right. I am probably wrong about the exact size.

But when that problem arises, the solution is to split the RES into several ones :-)

PostPosted: Thu Sep 25, 2008 5:31 pm
by JC
Antonio,

I use a .dll file to make the system more less. Our system have many dialogs.

Turning to resource everything, it will be very large. So, how is the best way? .DLL or several resouces?

PostPosted: Thu Sep 25, 2008 8:19 pm
by Antonio Linares
Julio,

Do you directly edit the DLL and modify it ?

Or do you keep a RC file that later on you place in the DLL ?

PostPosted: Thu Sep 25, 2008 10:59 pm
by JC
I edit directly with Pelles 5

PostPosted: Fri Sep 26, 2008 8:06 am
by Antonio Linares
Júlio,

You have two choices:

1) Create and use another DLL. You will have to switch from one to another in runtime from your application.

2) Extract the RC from your DLL, split it in two RC files and create two RES files. But you won't be able to keep using PellesC.

PostPosted: Fri Sep 26, 2008 1:11 pm
by JC
Antonio Linares wrote:Júlio,

You have two choices:

1) Create and use another DLL. You will have to switch from one to another in runtime from your application.

2) Extract the RC from your DLL, split it in two RC files and create two RES files. But you won't be able to keep using PellesC.


Both choices are not very good!
At first, I have to switch between .Dll
In the second, the size of the executable will grow a lot.

If were you Antonio, how they you choose?

PostPosted: Fri Sep 26, 2008 1:19 pm
by driessen
Julio,

This is the way I use, which works very fine.

1. I use Resource Workshop to make my DLL-files. I have 8 DLL-files in total, containing all my needed resources.

2. I save all these DLL-files as RC-files.

3. I use a simply BAT-command to make 1 RES-file. In this BAT-command, the MANIFEST.RC is added.

This is how MANIFEST.RC looks like :
Code: Select all  Expand view
#ifdef __FLAT__
1 24 "WindowsXP.Manifest"
#endif


This is how my BAT-command looks like :
Code: Select all  Expand view
COPY FILE1.RC+FILE2.RC+FILE3.RC+FILE4.RC+FILE5.RC+FILE6.RC+FILE7.RC+FILE8.RC+MANIFEST.RC FILEALL.RC
C:\PROGRA~1\BORLAND\BCC55\BIN\BRC32.EXE -R FILEALL.RC

The result is 1 file called FILEALL.RES

All my RC-files together are 2.5 MB, my RES-file is 1.3 MB.

4. I link the files FILEALL.RES into my application.

Indeed my application becomes bigger by using this method but who cares about the size of an executable. It is working very well.

PostPosted: Fri Sep 26, 2008 1:59 pm
by James Bott
Julio,

>In the second, the size of the executable will grow a lot.

Why is this a problem? The other way (using a DLL) the total size is probably similar (DLL + EXE). If you make any changes to the DLL you will still have to distribute the same size ZIP or install.

Regards,
James

PostPosted: Fri Sep 26, 2008 2:03 pm
by Antonio Linares
Julio,

Personally I prefer to work with RC files, as they are ascii files that can be edited with a source code editor (to search, do replacements, copy and paste, etc.)

PostPosted: Fri Sep 26, 2008 2:23 pm
by Gale FORd
I ran across some problems with editing large .dll with Resource Workshop. So now I create a .rc files for different sections of my program.
Then create .dll file with the following batch file for Borland compiler.

Code: Select all  Expand view
rem myrc2dll.bat
rem RC file to 32 bits resources DLL
rem Here is output file
set xdll=diwin32

rem Because sometimes uuid.lib gets lost I use copy to always have file.
copy uuid.lib.sav uuid.lib

c:\bcc55\bin\bcc32 -c c:\fwh\dll\screen32.c

rem Here compile my different .rc files
c:\bcc55\bin\brc32 -r diwindlg.rc
c:\bcc55\bin\brc32 -r diwinbmp.rc

c:\bcc55\lib\import32.lib,, %xdll%.res
c:\bcc55\bin\ilink32 /Tpd c:\bcc55\lib\c0d32.obj screen32.obj, %xdll%.dll,,c:\bcc55\lib\cw32.lib c:\bcc55\lib\import32.lib,, diwindlg.res diwinbmp.res
rem Notice you can add all .res files to line above

rem Now clean up all files not needed anymore.
del uuid.lib
rem goto done
del *.il*
del *.map
del *.obj
del *.res
del *.tds
:done
echo done!