This topic explains how to compile Visual C++ (unmanaged) and Qt applications in Microsoft Visual Studio 2005 - 2017 to prepare them for testing with TestComplete.
Note: | The screenshots below were made in Visual Studio 2008. |
-
Open your Visual C++ project in Visual Studio 2005 - 2017.
-
(Optional). To keep your release configuration intact, choose Build | Configuration Manager and select another configuration, say, Debug, as active for the project.
If you want to test the Release configuration, you can skip this step, but remember to restore the compiler settings after the testing is over.
-
Open the project properties. To do this, right-click the project in the Solution Explorer and select Properties from the context menu.
-
To provide TestComplete with information about internal methods and properties of MFC objects, you need compile the application with run-time type information (RTTI). To do this, select the Configuration Properties | C/C++ | Language category and set the Enable Run-Time Type Info option to Yes.
-
A Visual C++ application can be “open” to TestComplete with wrapper classes for MFC or with both wrapper classes and 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. Simply re-compile the application (Step 7).
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 at the previous step. To include debug info in the application, follow these steps:
-
In the project properties, select the Configuration Properties | C/C++ | General category and set the Debug Information Format option to either Program Database (/Zi) or Program Database for Edit and Continue (/ZI).
-
If your application contains MFC CGridCtrl controls and you use the Win32 Release configuration, select the Configuration Properties | C/C++ | Optimization category and set the Whole Program Optimization option to No.
-
Select the Configuration Properties | Linker | Debugging category and set the Generate Debug Info option to —
-
Generate Debug Information (/Debug) in Visual Studio 2010 - 2017
-
Yes (/DEBUG) in earlier versions of Visual Studio
Make sure the Generate Program Database File option specifies a valid path to the file that will hold debug information.
-
-
Select the Configuration Properties | Linker | Optimization category and set the Enable COMDAT Folding option to one of the following values:
-
Visual Studio 2010 - 2017: No (/OPT:NOICF).
-
Visual Studio 2008 or 2005: Default or Do Not Remove Redundant COMDATs (/OPT:NOICF).
-
-
-
If your application uses MFC classes, switch to the Configuration Properties | General page and specify whether you want to use MFC in static or shared DLLs in the Project Defaults | Use of MFC combo box:
If you use the Use MFC in a Shared DLL option, you need to: -
Copy MFC debug information files to the compiled application’s folder. For instructions, see Downloading MFC Debug Information.
-
Enable the Read debug information for statically linked libraries option in your TestComplete project.
-
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++ 6.0 Open Applications
Compiler Settings for Visual C++ 7.x Open Applications (Unmanaged Code)
Compiler Settings for Visual C++ Open Applications Created With Intel C++