tags:

views:

660

answers:

5

Hi,

I get the below error when I try to link resources in a dll.

[DCC Error] E2161 Error: RLINK32: Too many resources to handle.

Number of resources are more than 10K.

I am not sure, if there is any limit on the size of resource names in a dll. https://forums.codegear.com/message.jspa?messageID=58473

Is there any way to add more resources to a dll.

-Pavan.

A: 

I've not encountered this error myself, but if I did I think the first thing I would try would be to split my resources into separate RES files.

It may be that "too many" is too many in one go, and splitting the resources across multiple res files might break things down into more manageable chunks for RLINK32 to deal with.

But this is just guesswork on my part.

Deltics
I had tried this. Splitting into multiple RES files does not work.
Pavan
+3  A: 

As a workaround, you could consiolidate related images together in a single image and then slice out the pieces you need at run time. That's how Windows image-list controls work, for example.

Rob Kennedy
I agree with Rob if you MUST have them as resources.
skamradt
A: 

Split the resources into different DLLs or choose some container to store the files (for example some embedded database like SQL Lite, Eldos SoLFS storage, AidAim Single File System storage, or your own implementation) that can be attached at the end of the executable if possible (since you used Delphi 2009 you can do that with Post-Build commands). If you choose the second way your program will use less memory since the resource section will be smaller, also depending the implementation you can also protect the images with encryption or even compress them. Only minus is that you will have to create custom loading procedures to load the png data into your objects (not too hard).

pani
A: 

From no code changes to more modifications:
1. try to shorten the names of your resources
2. split your dll into multiple ones with a smaller number of resources (good way to organize them by nature or subject)
3. combine your image resources into multi-images strips (works well for icons, glyphs, etc... when the size is the same)

François
+1  A: 

The PngComponents have a component TPngImageCollection. Perhaps this will do for you.

Uwe Raabe