Dynamic Linking MFC and CRT

This tutorial describes setting up Coverage Validator to include or exclude different source files from coverage processing when you dynamically link your application with MFC and/or the C Runtime.

When you dynamically link to MFC and the CRT, the code for MFC and the CRT is held in separate DLLs to your application. This allows you to specify not to process MFC or CRT code by simply indicating which DLLs not to process – you don’t need to know where the source code for those DLLs is.

  • Open the settings dialog by clicking the tools icon on the toolbar.
    Coverage Validator settings toolbar
  • Select the Hooked DLLs tab.
    Coverage Validator Hooked DLLs settings
  • Click the Advanced… button to display the Hooked DLLs (Advanced) dialog.
    Coverage Validator Hooked DLLs advanced settings
  • To use the standard settings, select the first radio box. This will exclude MFC, MSVC, STL and Win32 DLLs from code coverage.
  • To customize which MFC, MSVC, STL and Win32 DLLs are processed for code coverage, select the second radio box, then select the checkboxes representing the DLLs for which you wish to collect code coverage data.
  • Click OK when you are satisfied with your selection.
  • Click OK to close the settings dialog.

Conclusion

You have learned how to customize the C runtime, MFC, STL and Win32 DLLs that will be considered for code coverage.

The default is to not process any of these DLLs, but if you wish to override that default you know how to do it.

Fully functional, free for 30 days