Downloading MFC Debug Information

Applies to TestComplete 15.47, last modified on January 20, 2023

To automate MFC controls in Visual C++ applications, you need to compile your tested application with debug information. However, if your application uses system MFC libraries (it is compiled with the Use of MFC option set to Use MFC in a Shared DLL), its debug information does not include MFC debug information. In this case, you need to manually add MFC debug information files (PDBs) to your application folder.

You can copy MFC PDBs from the Windows symbol cache on a development computer, or you can download them from the Microsoft Symbol Server (in this case, you need either any edition of Microsoft Visual Studio or the free Debugging Tools for Windows package).

After you get the MFC PDBs, enable the Read debug information for statically linked libraries option in the properties of your test project to make TestComplete use these files.

Getting MFC PDBs From Windows Symbol Cache

Some versions of Microsoft Visual Studio install MFC PDBs to the C:\Windows\Symbols\dll folder. If you have this folder, you can copy the needed MFC PDBs from there. Or you can ask the application developers to give you these files stored on their development computer.

  • Launch your tested application.

  • Run the following command in Windows Command Prompt:

    tasklist /m mfc*

    You will see the following output:

    Image Name           PID Modules
    =============== ======== ==========
    MyApp.exe           6068 mfc110.dll

    Note down the DLL name and whether it has the u and/or d suffixes (u means Unicode and d means debug version).

  • Find the matching PDB file in the C:\Windows\symbols\dll folder. If your application is 32-bit, look for the file name ending with .i386.pdb, if it is 64-bit - with .amd64.pdb.

    Examples:

    • For a 32-bit application that uses mfc110.dll, you need the mfc110.i386.pdb file.
    • For a 64-bit application that uses mfc90u.dll, you need the mfc90u.amd64.pdb file.
  • Copy this PDB file to your application’s folder.

Downloading MFC PDBs Using Microsoft Visual Studio

  • Create a folder (for example, C:\Symbols) to save the downloaded debug information.

  • From Visual Studio’s main menu, select Tools | Options and then select the Debugging | Symbols category.

  • Make sure the Symbol file (.pdb) locations list contains one of the following items and that the item is checked:

    • Microsoft Symbol Servers
    • http://msdl.microsoft.com/download/symbols

    If none are on the list, add the http://msdl.microsoft.com/download/symbols item and check it.

  • In the Cache symbols in this directory text box, enter the path to the folder you have created (in our example - C:\Symbols).

  • Click OK to close the Options dialog.

  • Launch your tested application.

  • From Visual Studio’s main menu, select Tools | Attach to Process.

  • Select your application in the list and click Attach. Wait until the debug information is loaded.

  • In the C:\Symbols folder, find all the subfolders named mfcNNN.pdb.

  • Copy the PDB files from these subfolders to your application folder.

The size of the PDB file must be more than 10 MB. If you get a smaller file, ask the application developers to give you the corresponding file from their Windows symbol cache (see above).

Downloading MFC PDBs Using Debugging Tools for Windows

  • Install Debugging Tools for Windows if you do not have them yet:

    • Open this page and scroll down to the Standalone Debugging Tools for Windows (WinDbg) section:

      http://msdn.microsoft.com/en-us/windows/hardware/hh852365

    • Download and install standalone debugging tools for your Windows version.

      In the installation program, select only the Debugging Tools for Windows item and unselect the other items.

  • Create a folder (for example, C:\Symbols) to save the downloaded debug information.

  • Launch your tested application.

  • Run the following command (on one line) in Windows Command Prompt. Make sure that you have replaced the highlighted values with the path to your Debugging Tools, with the application’s file name and with the path to the debug information folder.

    "C:\Program Files\Debugging Tools for Windows\symchk" /ie MyApp.exe /s SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

    Wait until the command execution is complete.

  • In the C:\Symbols folder, find all the subfolders named mfcNNN.pdb.

  • Copy the PDB files from these subfolders to your application folder.

The size of the PDB file must be more than 10 MB. If you get a smaller file, ask the application developers to give you the corresponding file from their Windows symbol cache (see above).

See Also

Testing Visual C++ Applications
Preparing Visual C++ Applications for Testing
List of MFC Controls

Highlight search results