Home Overview Localization of PE files Delphi/C++ Builder - VCL Resources
Localization of PE files Delphi/C++ Builder - VCL Resources PDF Print E-mail
Article Index
Localization of PE files Delphi/C++ Builder
VCL Resources
VCL Form Designer
VCL Resource Editor
Automatic selection of VCL ancestor classes
All Pages

VCL resources

Resources of VCL forms, frames and data modules are another type of localizable data in PE files, created in Delphi/C++Builder. Frames are containers with visual and non-visual components. Frames can be inserted to forms and other frames many times. Data modules are containers of non-visual components. All these resources are created in RT_RCDATA[#10].

Data inside a resource is stored as a tree, where the root is a form, frame, or data module. Names of resources correspond to names of VCL classes of these objects. In a general case, there is no exact match between data in a resource and properties of a created form (frame or data module) and components on it. VCL enables components to save into a resource their own internal data that may not possibly be changed in the Properties Inspector. The format of this data is entirely determined by the component code and is not known in a general case. You can view and change data of a resource in the resource editor on the Resource tab.

To edit a resource visually, you need to create and load from a resource its root object and then all of its components. Components are created based on names of classes (names of classes are contained in a VCL resource). To match names of classes and real data of classes, Radialix 2 uses a PE file to extract RTTI information – data about classes and data types used in an application. This data is required for correct editing of resources and for work of the form designer. If there is no RTTI information in a file, or it is packed, Radialix 2 tries to determine the class hierarchy using templates or indirectly. As a result, the program may determine incorrectly or fail to determine an ancestor class for some classes. Such a component will be displayed and edited in the designer incorrectly. Radialix 2 handles a component as unknown if its ancestor class is not determined. The list of unknown classes is displayed in the message window after adding a file to the project, or after updating project resources. You can see the list of unknown components in all project files and ancestors assigned to classes of these components in the Unknown Components dialog of the Project menu. This dialog also allows the user to select parents of unknown classes. The hierarchy of classes can be viewed in the Classes dialog, which also allows you to assign ancestors of classes.

In some cases, an attempt to create a visual representation of a form may fail. Too often it occurs due to incorrectly assigned ancestor classes. As a result, the user will not be able to edit a resource visually. The resource editor is the only way to edit in this situation.