SoConsole Class Reference

VSG extension Creates a Win32 console for printing messages More...

#include <Inventor/Win/SoConsole.h>

Inheritance diagram for SoConsole:
SoWinComponent

List of all members.

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)

Detailed Description

VSG extension Creates a Win32 console for printing messages

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.

SEE ALSO

SoWin, SoDebugError


Constructor & Destructor Documentation

SoConsole::SoConsole ( SoWidget  parent = NULL,
const char *  name = NULL,
SbBool  buildInsideParent = TRUE 
)

Constructor.

virtual SoConsole::~SoConsole (  )  [virtual]

Destructor.


Member Function Documentation

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.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/