When running an application that relies on a COM wrapper object, it is often difficult to determine when errors occur in the associated IDL object or IDL process. Since the instance of the wrapper object is invoked outside of IDL, the normal debugging capabilities of the IDL Workbench are not available.

However, it is possible to obtain this output by setting the IDL_BRIDGE_DEBUG environment variable. This debug information is usually written to stdout on Unix and Windows (unless noted otherwise in the following table). This output can also be captured in Visual Studio, the Debug Monitor (DBMON.exe) or WinDbg debugger on Windows. In each instance, the output depends on the value of the IDL_BRIDGE_DEBUG environment variable:




Turn off debug output


Turn on debug output, which includes output from library load errors, IDL execution errors, and PRINT statement output

The expected behavior in common debugging environments is described in the following table.


Debug Output

Console Application

Command window: Debug information is presented in line with any console window output when an .exe is executed from the Windows command window

Visual Studio: Debug output does not appear

DBMON: Debug information appears in the debug monitor window as it is generated

Windows Application

Command window: No debug output since the window that is launched has no knowledge of the debugging environment variable

Visual Studio: Debug output appears in the Debug Output window only when the application window is closed

DBMON: Debug information appears in the debug monitor window as it is generated

Note: In Windows, the environment variable is read when an application or command window is initially instantiated. For example, if you open Visual Studio and then change the value of the environment variable, you must re-launch Visual Studio to see the change in debug output behavior. DBMON is an exception as it always listens for debug information output and immediately reflects changes in content level.