An alternative for the standard debugging means TRACE and afxDump.
The output stream in question directs the output to a standard MFC editor window.
It is designed for using in MFC projects but it behaves like the std::cout in a console application.
In particular, when the OutputCOMEditor::flush()
function is called the new data appears in the editor window immediately (before exiting current scope of the code).
Such a property makes the stream helpful when debugging.
Note that the
manipulator endl does not flush the stream.
Demonstrations.
Description of components and installation
.
Example of using (the leftClick example).
Step-by-step explanation of implementation
.
This example elaborates on
-
how to attach a COM interface to an MFC class via Automation;
-
how to call a COM object from an Excel spreadsheet;
-
how to call a COM object from an MFC application;
-
how to debug a call via Automation.
-
how to supply a class derived from CDocument with a COM method allowing activation of
an associated frame from another application;
-
how to redirect output of an STL stream.