Public Member Functions | Public Attributes

MAXException Class Reference

Search for all occurrences

Detailed Description

See also:
Class FPInterfaceDesc, Function Publishing System.

Description:
This class is available in release 4.0 and later only.

Function Publishing interface functions can now report fatal error conditions to callers by using C++ exception-handling. This base class, MAXException, can be thrown directly, or subclassed as needed for error grouping. The class contains a message buffer and an optional error code. You would signal an error using the MAXException() constructor and the C++ throw statement, as in the following example:

...

if (discrim < 0.0) // oh-oh, not good

throw MAXException ("Unable to find root.", -23);

...

This signals a fatal error with the message and code shown. If the error occurs during a call to the function by MAXScript code, it will be trapped by MAXScript and the error message will be displayed and the running script will be terminated (but 3ds Max will continue running). If the error occurs during a C++-level call, typically the outer 3ds Max error catcher will catch and report the error and then exit 3ds Max, or clients of the interface can install their own catch code.
Data Members:
MSTR message;

The exception message.

int error_code;

The exception error code.

#include <ifnpub.h>

Inheritance diagram for MAXException:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MAXException (MCHAR *msg, int code=0)

Public Attributes

MSTR  message
int  error_code

Constructor & Destructor Documentation

MAXException ( MCHAR *  msg,
int  code = 0 
) [inline]
Remarks:
Constructor. The data members are initialized to the values passed.
Parameters:
MCHAR* msg

The exception message.

int code=0

The exception error code.
Default Implementation:
{}
: message(msg), error_code(code) { }

Member Data Documentation


MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException
MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException MAXException