In the most recent versions of Delphi, you could add resource scripts (.RC files) or compiled resource files (.RES files) to the Project Manager to let it compile them along with the project linking them to the executable. In Delphi 2009 managing resources has been simplified by the inclusion of a few more tools.
First, you can now drag individual resource files to the Project Manager to get them included as resources in a project. You can drag icons, bitmaps, and more. Delphi will generate a resource script files for these extra project resources, and compile it directly along with your program, embedding these resources in the executable. You can change any attribute of these resource files (including their internal name) in the Object Inspector:
J Properties [
File Name » Full Path
Resource Identifier Bitmap_Shipping Resource Type Bitmap
Second, under the Project pull-down of the main menu of the IDE there is a new menu item, Resources. Selecting this items brings up the Resources dialog box, which you can use to revise all of the resources of the program, add new resource files, rename them, change the format, and so on:
By adding a few resources to a project, at compile time Delphi will generate a proper resource file for you. For the ResourceTest program (with the resources depicted above), Delphi 2009 generates a resource script file listing the project resources called ResourceTestResource.rc:
Icon_Factory Icon "FACTORY.ICO" Bitmap_Shipping Bitmap "SHIPPING.BMP"
This resource script file is not added to the project (if you do so, you'll see duplicate resource warnings), but it is compiled along with it. In fact, if you make an error, like declaring your bitmap as an icon, the compiler will stop with the error:
Was this article helpful?
What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.