3ds Max C++ API Reference
DllDesc Class Reference

This class models a plug-in DLL. More...

#include <plugin.h>

+ Inheritance diagram for DllDesc:

Public Member Functions

CoreExport bool IsLoaded () const
 Returns true if the corresponding plug-in has been successfully loaded and initialized, false otherwise or if the plug-in has been defer-loaded. More...
 
CoreExport const MCHARDescription () const
 Returns the Description defined in the LibDescription function. More...
 
CoreExport int NumberOfClasses () const
 Returns the number of classes implemented in the DLL. More...
 
CoreExport ClassDescoperator[] (int i) const
 Returns a pointer to the 'i-th' class descriptor. More...
 
CoreExport ClassDescGetClassDesc (int i) const
 Returns a pointer to the 'i-th' class descriptor. More...
 
CoreExport int operator== (const DllDesc &dd) const
 Equality operator. More...
 
CoreExport bool HasRttiSupport () const
 Checks if this plugins dll was built with run-time type information (RTTI). More...
 
CoreExport bool IsBinaryCompatible () const
 Returns true if the plug-in DLL is binary compatible with the version of 3ds Max where it's being loaded into, false otherwise. More...
 
CoreExport ULONG GetVersion () const
 Returns the value reported by the LibVersion() function implemented by the plug-in DLL. More...
 
CoreExport bool IsDeferrable () const
 Returns whether the corresponding plug-in DLL can be defer loaded or not. More...
 
CoreExport bool ImplementsCanAutoDefer () const
 Returns whether the corresponding plug-in DLL implements the CanAutoDefer function or not. More...
 
CoreExport const MSTRGetFullPath () const
 Returns the full path of the plug-in DLL file this instance of DllDesc represents. More...
 
CoreExport const MSTRGetFileName () const
 Returns the file name and extension of the plug-in DLL this instance of DllDesc represents. More...
 
CoreExport const MSTRGetDirectoryName () const
 Returns the folder name with a trailing backslash of the plug-in DLL this instance of DllDesc represents. More...
 
CoreExport const HINSTANCE GetHandle () const
 Returns the module handle of the plug-in DLL represented by this DllDesc instance. More...
 
CoreExport DWORD GetSize () const
 Returns the size of the linear space that the plug-in DLL occupies in memory, in bytes, or 0 if the plug-in DLL is not loaded. More...
 
CoreExport FILETIME GetTimeLastModified () const
 Returns the date and time the plug-in DLL was last modified. More...
 
 DllDesc (HINSTANCE dllHandle, const MCHAR *dllFullPath, LibVersionProcPtr libVersionProcPtr, LibDescriptionProcPtr libDescriptionProcPtr, LibNumberClassesProcPtr libNumberClassesProcPtr, LibClassDescProcPtr libClassDescProcPtr, LibInitializeProcPtr libInitializeProcPtr, LibShutdownProcPtr libShutdownProcPtr, CanAutoDeferProcPtr canAutoDeferProcPtr, const FILETIME &timeLastWrite)
 
 DllDesc (const MCHAR *dllFullPath, const MCHAR *dllDescription, const FILETIME &timeLastWrite)
 
void Unload ()
 
BOOL CallInitialize ()
 
BOOL CallShutdown ()
 
 DllDesc (const DllDesc &other)
 
DllDesc operator= (const DllDesc &other)
 
 ~DllDesc ()
 

Static Public Member Functions

static CoreExport bool IsPluginDllVersionValid (ULONG pluginDllVersion)
 Verifies the validity of the specified plug-in DLL version. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

This class models a plug-in DLL.

3ds Max creates an instance of this class for each plugin dlls that it loads. This class allows for querying a number of plug-in DLL properties and the plug-in classes that expose.

Plugins must be built with support for RTTI, and must export all of the following functions in order for them to be loaded into 3ds Max.

Plugins may implement the following functions for added flexibility:

Class DllDir represents the plug-in Dll "registry" and offers various way to get to DllDesc instances.

See also
Class DllDir, Class ClassDesc, Class Interface,
Required DLL Functions
Deferred Loading of Plug-ins

Constructor & Destructor Documentation

◆ DllDesc() [1/3]

DllDesc ( HINSTANCE  dllHandle,
const MCHAR dllFullPath,
LibVersionProcPtr  libVersionProcPtr,
LibDescriptionProcPtr  libDescriptionProcPtr,
LibNumberClassesProcPtr  libNumberClassesProcPtr,
LibClassDescProcPtr  libClassDescProcPtr,
LibInitializeProcPtr  libInitializeProcPtr,
LibShutdownProcPtr  libShutdownProcPtr,
CanAutoDeferProcPtr  canAutoDeferProcPtr,
const FILETIME &  timeLastWrite 
)
explicit

◆ DllDesc() [2/3]

DllDesc ( const MCHAR dllFullPath,
const MCHAR dllDescription,
const FILETIME &  timeLastWrite 
)
explicit

◆ DllDesc() [3/3]

DllDesc ( const DllDesc other)

◆ ~DllDesc()

~DllDesc ( )

Member Function Documentation

◆ IsLoaded()

CoreExport bool IsLoaded ( ) const

Returns true if the corresponding plug-in has been successfully loaded and initialized, false otherwise or if the plug-in has been defer-loaded.

◆ Description()

CoreExport const MCHAR* Description ( ) const

Returns the Description defined in the LibDescription function.

◆ NumberOfClasses()

CoreExport int NumberOfClasses ( ) const

Returns the number of classes implemented in the DLL.

This is the value returned by the library function LibNumberClasses.

◆ operator[]()

CoreExport ClassDesc* operator[] ( int  i) const

Returns a pointer to the 'i-th' class descriptor.

Parameters
i- The zero based index of the ClassDesc to return.
Returns
Pointer to a class descriptor.

◆ GetClassDesc()

CoreExport ClassDesc* GetClassDesc ( int  i) const

Returns a pointer to the 'i-th' class descriptor.

This method is identical to DllDesc::operator[](int).

Parameters
i- The zero based index of the ClassDesc to return.
Returns
Pointer to a class descriptor.

◆ operator==()

CoreExport int operator== ( const DllDesc dd) const

Equality operator.

Always returns zero.

◆ HasRttiSupport()

CoreExport bool HasRttiSupport ( ) const

Checks if this plugins dll was built with run-time type information (RTTI).

Precondition
NumberOfClasses must return a positive non-zero value for the check to be performed
Returns
Returns true if the dll was built with RTTI, otherwise false. In the later case, the plugin dll will not be loaded into 3ds Max and DllDesc::IsLoaded() will return false.

◆ IsBinaryCompatible()

CoreExport bool IsBinaryCompatible ( ) const

Returns true if the plug-in DLL is binary compatible with the version of 3ds Max where it's being loaded into, false otherwise.

If it return false the plugin dll will not be loaded into 3ds Max and DllDesc::IsLoaded() will return false.

◆ GetVersion()

CoreExport ULONG GetVersion ( ) const

Returns the value reported by the LibVersion() function implemented by the plug-in DLL.

◆ IsDeferrable()

CoreExport bool IsDeferrable ( ) const

Returns whether the corresponding plug-in DLL can be defer loaded or not.

◆ ImplementsCanAutoDefer()

CoreExport bool ImplementsCanAutoDefer ( ) const

Returns whether the corresponding plug-in DLL implements the CanAutoDefer function or not.

◆ IsPluginDllVersionValid()

static CoreExport bool IsPluginDllVersionValid ( ULONG  pluginDllVersion)
static

Verifies the validity of the specified plug-in DLL version.

The supplied version number is valid if it identifies a 3ds Max SDK version that is binary compatible with the one used to compile the instance of 3ds Max that is being asked to validate this version number.

Parameters
pluginDllVersionThe plug-in DLL version to validate. This is a value returned by the plug-in DLL's LibVersion() function.
Returns
True if the supplied plug-in DLL version number corresponds to a plug-in DLL that is binary compatible with the instance of 3ds Max that is currently used.

◆ GetFullPath()

CoreExport const MSTR& GetFullPath ( ) const

Returns the full path of the plug-in DLL file this instance of DllDesc represents.

◆ GetFileName()

CoreExport const MSTR& GetFileName ( ) const

Returns the file name and extension of the plug-in DLL this instance of DllDesc represents.

◆ GetDirectoryName()

CoreExport const MSTR& GetDirectoryName ( ) const

Returns the folder name with a trailing backslash of the plug-in DLL this instance of DllDesc represents.

◆ GetHandle()

CoreExport const HINSTANCE GetHandle ( ) const

Returns the module handle of the plug-in DLL represented by this DllDesc instance.

The module handle should not be used to load or unload the plug-in DLL.

◆ GetSize()

CoreExport DWORD GetSize ( ) const

Returns the size of the linear space that the plug-in DLL occupies in memory, in bytes, or 0 if the plug-in DLL is not loaded.

◆ GetTimeLastModified()

CoreExport FILETIME GetTimeLastModified ( ) const

Returns the date and time the plug-in DLL was last modified.

◆ Unload()

void Unload ( )

◆ CallInitialize()

BOOL CallInitialize ( )

◆ CallShutdown()

BOOL CallShutdown ( )

◆ operator=()

DllDesc operator= ( const DllDesc other)