Enabling QueryInterface Debugging

ATL has built-in support for debugging QueryInterface calls. You enable this support using the following two-step process.

To enable QueryInterface debugging

  1. Run the FINDGUID program which comes with ATL and specify -insert as the command line parameter:

    findguid -insert

    This ensures all the common IIDs are in the interfaces section of your registry. You need to only do this once.

  2. Add the following line before including atlcom.h:

    #define _ATL_DEBUG_QI

Once you've enabled QueryInterface debugging, the debug output window of Visual C++ will display the name of each interface that is queried for on your object.