Preparing Developer Express VCL Components for C++Builder Applications

Applies to TestLeft 15.40, last modified on March 17, 2022

Developer Express VCL controls for C++Builder are distributed without debug information. By default, TestLeft cannot access internal properties and methods of such controls in C++Builder applications.

You can recompile Developer Express VCL controls for C++Builder with debug information to use them in your tests:

  1. Install Developer Express VCL controls with integration into your version of Embarcadero C++Builder.

  2. Copy the directory that contains the installed Developer Express VCL controls (by default, it is the C:\Program Files\Developer Express.VCL directory) to another location on the hard disk (for instance, to the C:\Components\Developer Express.VCL_copy directory).

  3. Run the Developer Express VCL controls installation program once again, select the Modify installation type and re-install the controls without integration into your version of Embarcadero C++Builder. This will unregister the controls from C++Builder.

  4. Create a new directory for the debug version of the Developer Express VCL controls which you are going to re-compile. For simplicity, we will consider re-compiling only the Developer Express VerticalGrid control. You can re-compile other Developer Express VCL controls with debug information in the same way. For instance, create the <RAD Studio Projects>\VerticalGrid_Debug directory for the debug version of the VerticalGrid control.

  5. Copy all the .pas files from the directory that contains the copy of the Developer Express VCL controls which has been created before (in our case, it is the C:\Components\Developer Express.VCL_copy directory) and from all its subdirectories to the directory for the debug version of the controls which has been created in the previous step (the <RAD Studio Projects>\VerticalGrid_Debug directory).

    Note: Copy all the .pas files to a common directory. There can be files with identical file names. You can replace equally named files while copying.
  6. Run Embarcadero C++Builder and create a new package project (select File | New | Package from the main menu).

  7. Select File | Save All from the main menu and save the project to the directory for the debug version of the controls to which you have copied the .pas files (<RAD Studio Projects>\VerticalGrid_Debug).

  8. Right-click the Contains directory in the project tree displayed in the Project Manager panel and select Add from the context menu.

  9. In the Add dialog, click the Browse button on the Add Unit tab.

    In the Unit file name dialog, choose the .pas source files that implement the controls to re-compile. In our case, for the VerticalGrid control, choose the cxVGrid.pas and cxVGridReg.pas files that you have copied to the <RAD Studio Projects>\VerticalGrid_Debug directory. If you want to compile other controls, specify the appropriate .pas source files. Click Open in the Unit file name dialog and click OK in the Add dialog.

  10. After you include the source files in the project, remove all *14.bpi files (if any) from the Requires directory in the project tree that the Project Manager panel shows. To remove such a file from the project, right-click the file in Project Manager and select Remove From Project from the context menu.

    Note: The names of .bpi files depend on your version of C++Builder and they differ in different versions of C++Builder.
  11. Configure the project to compile the controls with debug information:

    • Select Project | Options from the main menu.

    • In the resulting Project Options dialog, switch to the C++ Compiler | Debugging category and set the Debug information and Debug line number information options to True:

    • Switch to the C++ Compiler | Optimizations category and set the Disable all optimizations option to True:

    • Switch to the C++ Linker category and set the Full debug information option to True:

    • Switch to the Delphi Compiler | Compiling category and set the Use debug .dcus and Stack frames options to True.

      Set the Optimization option to False.

      Specify the “-JPHNE -M -LUdclstd -LUdcldb” parameter string in the Additional options to pass to the compiler option:

    • Switch to the Delphi Compiler | Linking category and set the Debug information and Include remote debug symbols options to True:

    Click OK to save the changes and close the Project Options dialog.

  12. Select Project | Build Project_Name from the main menu to build the project.

    During the compilation, some .res, .dfm and other files from the Developer Express controls package may be required for C++Builder to compile the control. In this case, find the required files (you can see their names in the Output window of C++Builder) in the C:\Components\Developer Express.VCL_copy directory (to this directory, we have saved a copy of the Developer Express VCL controls) and its subdirectories. Copy the files to the <RAD Studio Projects>\VerticalGrid_Debug directory (the directory containing the debug version of the control).

    Try to build the project again.

    Repeat this step until the project is built successfully.

  13. After you build the project, install the compiled debug version of the Developer Express VCL control to integrate it into C++Builder. Right-click the project node in Project Manager and select Install from the context menu.

    Now, the debug version of the control is integrated into C++Builder and you can use it in your C++Builder applications.

Repeat the steps to recompile the other Developer Express VCL controls with debug information.

After you have recompiled Developer Express VCL controls with debug information and registered them in your Embarcadero C++Builder, you can use these controls in your C++Builder applications. TestLeft will be able to access the controls, their internal properties and methods.

Besides compiling your C++Builder application with debug information, re-compile Developer Express VCL controls with debug information as well. Before compiling your project, set the project options as it is described above in step 11 (except for setting the Additional options to pass to the compiler option).

When you try to compile your C++Builder application using the re-compiled debug version of Developer Express VCL controls, C++Builder may require some additional source files, and this can cause errors during the compilation.

Search for the required files in the directory that contains the re-compiled debug version of Developer Express VCL controls (in our case, these controls reside in the <RAD Studio Projects>\VerticalGrid_Debug directory). Copy the files to your application project’s directory.

After that, try to compile the application again. If C++Builder requires other files from the controls’ package again, repeat this operation until your application is compiled successfully.

Highlight search results