3ds Max C++ API Reference
assert1.h File Reference
#include "buildver.h"
#include "utilexp.h"
#include "maxheap.h"
#include "strbasic.h"
#include <tchar.h>

Classes

class  CAssertCB
 Callback class that allows for hooking into 3ds Max's assertion mechanims. More...
 

Macros

#define assert(expr)   ((void *)0)
 
#define DbgAssert(expr)
 
#define DbgVerify(expr)   ( expr )
 

Functions

UtilExport int assert1 (int line, const char *file, const char *function=NULL, const char *expr=NULL)
 Method to be called to signal a violation of some assumption in the code. More...
 
UtilExport int assert1 (int line, const wchar_t *file, const wchar_t *function=NULL, const wchar_t *expr=NULL)
 
UtilExport int assert1 (int line, const wchar_t *file, const char *function=NULL, const wchar_t *expr=NULL)
 
UtilExport CAssertCBSetAssertCB (CAssertCB *cb)
 Sets a callback object that allows for performing a custom action when an assertion fails (is triggered). More...
 

Function Documentation

◆ assert1() [1/3]

UtilExport int assert1 ( int  line,
const char *  file,
const char *  function = NULL,
const char *  expr = NULL 
)

Method to be called to signal a violation of some assumption in the code.

This method should not be called directly, but rather via the various assertion macros such as DbgAssert, MaxAssert, DbgVerify, etc.

Parameters
line- the line number where the assertion occurred
file- the file path and name where the assertion occurred
function- the non-decorated name of the function in which the assertion occurred
expr- the expression that was asserted
Returns
Currently, this method either returns TRUE or it triggers the shutdown of 3ds Max

◆ assert1() [2/3]

UtilExport int assert1 ( int  line,
const wchar_t *  file,
const wchar_t *  function = NULL,
const wchar_t *  expr = NULL 
)

◆ assert1() [3/3]

UtilExport int assert1 ( int  line,
const wchar_t *  file,
const char *  function = NULL,
const wchar_t *  expr = NULL 
)

◆ SetAssertCB()

UtilExport CAssertCB* SetAssertCB ( CAssertCB cb)

Sets a callback object that allows for performing a custom action when an assertion fails (is triggered).

A plugin can supply an object that allows for executing a custom action when an assertion fails in 3ds Max. For details on the extent of possible customization see class CAssertCB. Currently, only one callback object can be active at any given time. This means that the callback installed by a plugin can be de-installed by another plugin. Thus, plugins should keep their callbacks active for as short of a time period as possible, and restore the previous callback object when they de-activate their own.

Parameters
cb- The new callback object to use
Returns
The old callback object or NULL if there's none set