3ds Max C++ API Reference
Loading...
Searching...
No Matches
exceptions.h File Reference

Classes

class  MAXScriptException
class  MAXScriptException::ScopedMXSCallstackCaptureDisable
 helper class for disabling mxs callstack capture if an exception is thrown. More...
class  MAXScriptException::ScopedCplusplusCallstackCaptureDisable
 helper class for disabling c++ callstack capture if a system exception is thrown. More...
class  MAXScriptRuntimeErrorException
class  UnknownSystemException
class  SignalException
 This is the exception that is thrown if the user breaks execution by pressing and holding the escape key. More...
class  CompileError
class  SyntaxError
class  TypeError
class  NoMethodError
class  AccessorError
class  AssignToConstError
class  ArgCountError
class  RuntimeError
class  UserThrownError
class  DebuggerRuntimeError
class  IncompatibleTypes
class  ConversionError
class  FunctionReturn
class  LoopExit
class  LoopContinue
class  MaxShutdownException
class  CallStackOverflowException
 Exception thrown when calling a scripted function with less than 256k program call stack remaining. More...
class  SecurityException
 Exception thrown when attempting to execute MAXScript commands that are disallowed by ISceneScriptSecurityManager. More...

Macros

#define unimplemented(m, t)

Functions

ScripterExport void ProcessMAXScriptException (MAXScriptException &e, const MSTR &caption, bool displayErrorMessageBox, bool showSourcePosition, bool isTerminalHandling, bool quietErrors=false)
 These methods centralize the handling of maxscript exceptions in c++ code.
void ProcessUnknownMAXScriptException (const MSTR &caption, bool displayErrorMessageBox, bool showSourcePosition, bool isTerminalHandling, bool quietErrors=false)

Macro Definition Documentation

◆ unimplemented

#define unimplemented ( m,
t )
Value:
throw NoMethodError (m, t)
Definition exceptions.h:209

Function Documentation

◆ ProcessMAXScriptException()

ScripterExport void ProcessMAXScriptException ( MAXScriptException & e,
const MSTR & caption,
bool displayErrorMessageBox,
bool showSourcePosition,
bool isTerminalHandling,
bool quietErrors = false )

These methods centralize the handling of maxscript exceptions in c++ code.

Typical usage looks like:

ScopedMaxScriptEvaluationContext scopedMaxScriptEvaluationContext; MAXScript_TLS* _tls = scopedMaxScriptEvaluationContext.Get_TLS(); two_value_locals_tls( thingValue, propNameValue ); try { ScopedSaveCurrentFrames scopedSaveCurrentFrames(_tls); vl.thingValue = InterfaceFunction::FPValue_to_val( thing ); vl.propNameValue = Name::intern( propName ); vl.thingValue = vl.thingValue->get_property( &vl.propNameValue, 1 ); vl.thingValue->to_fpvalue( retVal ); } catch (MAXScriptException& e) { ProcessMAXScriptException(e, _T("GetScriptedProperty"), false, false, true); } catch (...) { ProcessUnknownMAXScriptException(_T("GetScriptedProperty"), false, false, true); }

Parameters
eThe maxscript exception to process
captionThe string to be used in the title bar of the error message box, and is used as part of the verbose description of the exception. Can be null.
displayErrorMessageBoxIf true, an error message box is displayed (unless max is in quiet mode).
showSourcePositionIf true, source position of error is shown in Scripting editor.
isTerminalHandlingIf true, terminal handling of the exception is occurring. If false, the catch will be rethrowing the exception.
quietErrorsIf true, error information is not written to Listener, a brief description of the exception and its source location is written to the log file.

◆ ProcessUnknownMAXScriptException()

void ProcessUnknownMAXScriptException ( const MSTR & caption,
bool displayErrorMessageBox,
bool showSourcePosition,
bool isTerminalHandling,
bool quietErrors = false )
inline
441{
443 ProcessMAXScriptException(e, caption, displayErrorMessageBox, showSourcePosition, isTerminalHandling, quietErrors);
444}
Definition exceptions.h:138
ScripterExport void ProcessMAXScriptException(MAXScriptException &e, const MSTR &caption, bool displayErrorMessageBox, bool showSourcePosition, bool isTerminalHandling, bool quietErrors=false)
These methods centralize the handling of maxscript exceptions in c++ code.