Anyone know how to list all the resources defined by name and type in a library or package?

Anyone know how to list all the resources defined by name and type in a library or package?
I've created a library with multiple images in. Rather than knowing beforehand the available images, I would like to read the list of available at runtime to allow the user to choose which one to load.

Comments

  1. If there is no standard implemented function of sorts, I'm thinking I'll create a TStringlist constant in a unit in the library/package and populate it in the initialization section of the unit with the names of all the resource images that I have loaded. It's not pretty, but it should work. Any comments? :)

    ReplyDelete
  2. Heinz Toskano​ He isn't asking about exported functions. Or about the types used by a library. He asking about the resources linked to the executable.

    ReplyDelete
  3. Correct! :) I've decided to make my life simple and add a unit with a StringList that gets populated at creation with the list of resources in the library. That way it will work on all platforms.
    FYI, I'm also switching to packages rather than DLL libraries so I can add more things in like a frame that can be used to show the list for selection.

    ReplyDelete

Post a Comment