Preparing TMS Software VCL Components for C++Builder Applications

Applies to TestComplete 14.93, last modified on September 27, 2021

If you use TMS Software VCL controls in your C++Builder application and want to test the application with TestComplete, we recommend that you re-compile the utilized TMS components with full debug information before including them in your application. This is necessary to make TestComplete recognize such VCL controls properly and obtain access to their properties and methods when testing your C++Builder application. In this topic, we will explain how you can prepare TMS Software VCL components for C++Builder and use them in your tested C++Builder applications.

We will consider preparing TMS Software VCL controls for CodeGear C++Builder 2007 applications.

Note: To re-compile the components with full debug information, you need a TMS Software controls package that contains the source files of the components.

To re-compile the components with full debug information and re-install them, follow the steps below:

  1. Create a new directory for the debug version of the TMS Software VCL components which you are going to re-compile. For simplicity, we will consider re-compiling only the TMS AdvStringGrid control. You can re-compile other TMS Software VCL components with debug information in the same way. For instance, create the <RAD Studio Projects>\AdvStringGrid_Debug directory for the debug version of the AdvStringGrid component.
  2. Copy all of the .pas source files from your TMS Software VCL components package to the directory for the debug version of components (the <RAD Studio Projects>\AdvStringGrid_Debug directory), which was created in the previous step.
    Note: All of the .pas files must be copied to one common directory. There can be files with identical file names. You can replace equally named files while copying.
  3. Run CodeGear C++Builder 2007 and create a new package project (select File | New | Package from the main menu).
  4. Select File | Save All from the main menu and save the project to the directory for the debug version of components, to which you have copied the .pas files (<RAD Studio Projects>\AdvStringGrid_Debug).
  5. Right-click the Contains directory in the project tree displayed in the Project Manager panel and select Add from the context menu.
  6. In the ensuing Add dialog, click the Browse button on the Add Unit tab. In the Unit file name dialog that appears, choose the .pas source files in which the components to be re-compiled are implemented. In our case, for the AdvStringGrid control, choose the advgrid.pas and asgreg.pas files that have been copied to the <RAD Studio Projects>\AdvStringGrid_Debug directory. If you want to compile other components, specify the appropriate .pas source files. Click Open in the Unit file name dialog and click OK in the Add dialog.
  7. Now, you need to set some project options so that the components are compiled with full debug information. Select Project | Options from the main menu. In the ensuing Project Options dialog, perform the following actions:
    • Switch to the C++ Compiler | Debugging category and enable the Debug information and Debug line number information options in the Debugging group:
    • Switch to the C++ Compiler | Optimizations category and select None in the Optimizations group:
    • Switch to the Linker | Linking category and enable the Full debug information option:
    • Switch to the Delphi Compiler | Compiling category. In the Debugging group, enable the Debug information and Local debug symbols options. In the Code generation group, enable the Generate stack frames option and disable the Optimization option:

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

  8. Select Project | Build Project_Name from the main menu to build the project. During the compilation process, some .res, .dfm and other files from the TMS Software components package may be required for C++Builder to compile the component. In this case, find the required files (you can see their names in the Output window of C++Builder) in the directory, where your TMS Software components package containing the source files resides, and copy the files to the <RAD Studio Projects>\AdvStringGrid_Debug directory (the directory containing the debug version of the component). Try to build the project again. Repeat the step until the project is built successfully.
  9. After the project is built, you must install the compiled debug version of the TMS Software VCL component 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 component is integrated into C++Builder and can be used in your C++Builder applications.

You can perform the steps described above to re-compile other TMS Software VCL components with full debug information. For the list of TMS Software VCL controls supported by TestComplete, see the Supported TMS Controls topic.

As you have re-compiled TMS Software VCL components with full debug information and registered them in your CodeGear C++Builder 2007, you can use these components in your C++Builder applications, and TestComplete can obtain access to TMS Software VCL controls used in your applications, to their properties and methods.

Note that besides compiling your C++Builder application with debug information, you must re-compile TMS Software VCL components with debug information as well. Before compiling your project, set the project options as it is described above in step 7.

When you try to compile your C++Builder application by using the re-compiled debug version of TMS Software VCL controls, C++Builder may require some additional source files, and this can cause errors during the compilation process. Search for the required files in the directory that contains the re-compiled debug version of TMS Software VCL controls (in our case, these components reside in the <RAD Studio Projects>\AdvStringGrid_Debug directory) and 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 components’ package again, repeat this operation until your application is compiled successfully.

To learn how to include debug information in applications created with CodeGear C++Builder 2007, see also Compiling C++Builder 2007 Applications With Debug Information.

See Also

Debug Info Agent™
Testing C++Builder Applications
Compiling C++Builder 2007 Applications With Debug Information
Supported TMS Controls
TMS TAdvGlowButton Support
TMS TAdvStringGrid Support

Highlight search results