Creates a Win32 console for printing messages More...
#include <Inventor/Win/SoConsole.h>
Public Member Functions | |
SoConsole (SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE) | |
virtual | ~SoConsole () |
HWND | getConsoleHandle (void) |
void | printMessage (const SbString &str) |
Static Public Member Functions | |
static void | setMaxNumMessages (int) |
The SoConsole class provides a convenient way to display Open Inventor error messages or other application debug messages in a Win32 console. This can be a very useful feature for simple Win32 applications.
There is only one error console per application. To get this console, call SoWin::getErrorConsole(). It is then possible to print messages to it using the printMessage function.
The console replaces the original message box mechanism. Every Open Inventor error is caught and written to the console. This includes user-defined error messages that are generated with SoDebugError. For example, SoDebugError::post("YourClass", "YourMessage") will print your message to the console.
Due to a Windows programming limitation, the console is not usable in multi-threaded applications. In this case, it is possible to switch to the original message box mechanism by setting environment variable OIV_OLD_ERROR_HANDLER.
The Save button allows the user to save error information into a file named oivErrorFile.txt. The Clear button deletes all error messages currently displayed in the console.
SoConsole::SoConsole | ( | SoWidget | parent = NULL , |
|
const char * | name = NULL , |
|||
SbBool | buildInsideParent = TRUE | |||
) |
Constructor.
virtual SoConsole::~SoConsole | ( | ) | [virtual] |
Destructor.
HWND SoConsole::getConsoleHandle | ( | void | ) |
Returns a handle to the console.
void SoConsole::printMessage | ( | const SbString & | str | ) |
Sends a message to the console.
static void SoConsole::setMaxNumMessages | ( | int | ) | [static] |
Sets the maximum number of messages to be printed in the console.