User Tools

Site Tools


how_to_link_external_resources.htm
Navigation:  How To's and Troubleshooting > How to… >====== How to Link External Resources ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

The Project System (Solution Explorer) allows you to specify external resources to link into the executable. These include graphics, such as .BMP, .ICO and .WMF files. By linking them into the executable, you can avoid having to ship them as separate, external files.

If you directly reference a graphic file within a data structure, the compiler automatically links the graphic, so there is no need to add the graphic file to your Project Tree. For example, if you place an IMAGE control in a window, and specify a file by name in the Properties Pad dialog, the linker automatically includes that file in your executable. But if you assign a different graphic to a control using a runtime property assignment statement, the linker will only include the new file in your executable if you add the file to your Project Tree.

To add graphic files to the executable:

1.In the Solution Explorere, RIGHT-CLICK on the Libraries, Objects and Resource files note and select the Add Libraries, Objects and Resource files menu item.

Select the bitmap, icon, or metafile graphic from the standard Open File dialog.

2.Press the Open button to return to the Solution Explorer.

3.Highlight the source code file that references the graphic in the Application Tree, press the Embeds button, and locate the appropriate Embed point.

The source code file is opened by the Text Editor.

4.Place a tilde (~) in front of the graphic file name in the source code assignment statement (not in data section).

For example: change ?Image{PROP:Text} = 'I.ICO' to ?Image{PROP:Text} = '~I.ICO.' The tilde indicates the program should find the item as a linked in resource, not as an external file.

Optionally, choose Search C6H0013.jpg Find to locate the file name.

5.Choose Save and Close, then CLICK on Yes when asked if you want to save.

Now, when you recompile and link, the executable will no longer require the external graphic file.

how_to_link_external_resources.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1