Debugging COM Wrapper Objects
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 as described in
IDL_BRIDGE_DEBUG (Using IDL). 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:
|
Value
|
Behavior
|
|---|---|
|
|
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.
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.