Compiler Settings for Visual C++ 7.x Open Applications (Unmanaged Code)

Applies to TestComplete 15.69, last modified on November 13, 2024

This topic explains how to compile Visual C++ (unmanaged) and Qt applications in Microsoft Visual Studio 2002 and 2003 to prepare them for testing with TestComplete.

  1. Open your Visual C++ 7.x project in Microsoft Visual Studio .NET 2002 (7.0) or 2003 (7.1), depending on which version of Visual Studio the project was created in.

  2. (Optional). To keep your release configuration intact, choose Build | Configuration Manager and select another configuration, say, Debug, as active for the project.

    Configuration Manager

    If you need to test the Release configuration, you can skip this step, but remember to restore the compiler settings after the testing is over.

  3. Open the project properties. To do this, right-click the project in the Solution Explorer and select Properties from the context menu.

  4. In the Project Properties dialog, select the Configuration Properties | C/C++ | Optimization category and set the Optimization option to Disabled (/Od).

    Project Properties: Optimization property page
  5. To provide TestComplete with information about internal methods and properties of MFC objects, you need to compile the application with run-time type information (RTTI). To do this:

    • In the Project Properties dialog, select the Configuration Properties | C/C++ | Language category.

    • Set the Enable Run-Time Type Info option to Yes (/GR):

      Project Properties: Language property page
  6. A Visual C++ application can be “open” to TestComplete with wrapper classes for MFC or with both wrapper classes and the Debug Info Agent™ (see Testing Visual C++ Applications - Overview).

    If you are going to “open” the application using wrapper classes, then you are done with the settings and you just need to re-compile the application (Step 8).

    If you are going to use the Debug Info Agent™, then you need to compile your application with both run-time type information (RTTI) and debug information. We included RTTI in the previous step. To include debug info in the application, follow these steps:

    • In the Project Properties dialog, select the Configuration Properties | C/C++ | General node and set the Debug Information Format option to either Program Database (/Zi) or Program Database for Edit and Continue (/ZI).

      Project Properties: General property page
    • Select the Configuration Properties | Linker | Debugging category and set the Generate Debug Info option to Yes (/DEBUG). Also, make sure the Generate Program Database File option on this page specifies a valid path to the file that will hold debug information.

      Project Properties: Debugging property page
    • Select the Configuration Properties | Linker | Optimization category and set the Enable COMDAT Folding option to either Default or Do Not Remove Redundant COMDATs (/OPT:NOICF).

      Project Properties: Optimization property page
  7. If your application uses MFC classes, select the Configuration Properties | General category and specify whether you want to use MFC in static or shared DLLs in the Project defaults | Use of MFC combo box:

    Project Properties: General property page
    If you use the Use MFC in a Shared DLL option, you need to:
  8. Re-compile your application.

When your application is ready for the final delivery, remember to compile it without debug information and RTTI to reduce the application size.

See Also

Testing Visual C++ Applications - Overview
Changes in MFC Classes Notation
Compiler Settings for Visual C++ Open Applications Created With Intel C++
Compiler Settings for Visual C++ 8.0 and Later Open Applications (Unmanaged Code)

Highlight search results