Compiling and Debugging Line Counter

 

Compiling - The Pitfalls

The Line Counter project file includes the HTML Help Project file (LineCount.hhp) which creates this help file using the HTML Help Compiler (hhc.exe). If you don't have the HTML Help Authoring System installed on your system, you will not be able to compile the Line Counter project in it's default configuration.

Two options are available to remedy the situation:

  1. Download the free HTML Help Authoring System from Microsoft from this URL: http://msdn.microsoft.com/library/tools/htmlhelp/wkshp/download.htm
  2. Exclude LineCount.hhp from the build process, and simply use the .CHM file that came with the distribution. To exclude LineCount.hhp, select Project|Settings, and highlight LineCount.hhp in the file list. On the right side of the dialog, select the "General" tab, and check the box titled "Exclude file from build".


Debugging DevStudio Add-Ins

To debug a DevStudio Add-In, you must load DevStudio with the Add-In disabled (i.e., go to Tools|Customize|Add-Ins and disable the add-in). When you load DevStudio the next time, the add-in will not be in memory, so you will be able to overwrite the .dll file when you compile the project.

After the compilation, execute the program. Since the add-in is nothing more than a .dll, you will be prompted for a program to run. Specify the full path to MSDEV.EXE. You'll get a warning message specifying that your program has no debugging information, because MSDEV.EXE itself has none. This warning can be safely ignored.

Once MSDEV.EXE is running under the debugger, you can reactivate the add-in from the Tools|Customize|Add-Ins dialog. The add-in will be loaded with it's debugging information (if you compiled a Debug build), and you should be able to set breakpoints and debug at will. The next time you run MSDEV.EXE from the project workspace, the add-in will get loaded with it automatically.