DllDir Class Reference

#include <plugin.h>

Class Description

Represents the plug-in DLL "directory", which is a registry of every plug-in DLL loaded by 3ds Max.

It also encapsulates the ClassDirectory which is a registry of all classes implemented in the plug-in DLLs. The following diagram shows the relationship between the classes that make up the DllDir structure. The lines in the diagram indicate how the objects are accessed. Class DllDir provides access to a list of DllDesc objects. Each of these has a list of ClassDesc objects. Class ClassDirectory provides access to the a table of SubClassList objects which are grouped by super class ID. Each SubClassList has a series of ClassEntry objects. The ClassEntry object provides information about the plug-in classes (some of the same information as the class descriptor, usage counts, etc.).

dlldir_wmf.gif

DllDir is a singleton; its sole instance can be retrieved by DllDir::GetInstance() or Interface::GetDllDir(). All methods of this class are implemented by the system.

See also
Class DllDesc, Class ClassDirectory, Class ClassDesc, Class ClassEntry, Class Interface.
+ Inheritance diagram for DllDir:

Public Member Functions

virtual ~DllDir ()=0
 
CoreExport int Count () const
 Returns the number of plug-in DLLs currently loaded. More...
 
CoreExport const DllDescoperator[] (int i) const
 Returns a reference to the i-th DllDesc that represents a loaded plug-in dll. More...
 
CoreExport const DllDescGetDllDescription (int i) const
 Returns a reference to the i-th DllDesc that represents a loaded plug-in dll. More...
 
CoreExport ClassDirectoryClassDir () const
 Returns a reference to the ClassDirectory. More...
 
CoreExport const DllDescGetDllDescriptionForClass (SClass_ID superClassId, const Class_ID &classId)
 Returns the DllDesc that contains the definition of a class with the specified class and superclass IDs. More...
 
CoreExport int FindDllDescFromDllPath (const MaxSDK::Util::Path &aFullPath) const
 Returns the DllDesc index within the DLL Directory (DllDir) for a given full path. More...
 
CoreExport int FindDllDescFromHInstance (const HINSTANCE hInst) const
 Returns the DllDesc index within the DLL Directory (DllDir) for a given module handle. More...
 
Methods for loading plug-in dlls

The following methods load plug-in dlls.

In most cases plug-ins do not need to call these methods since 3ds Max will automatically attempt to load all plug-in dlls found in the "stdplugs" folder and in all other folders specified by the user in Configure System Paths > 3rd Party Plug-ins. Note that when 3ds Max attempts to load its plug-ins during it's startup, it will defer as many plug-ins as possible. One case in which a plug-in needs to call one of these methods is when it has a run-time dependency on special functionality exposed by another plug-in dll and it wants to make sure that the plug-in dll was not defer loaded by 3ds Max. Note that creating an instance of a plug-in object residing in a defer loaded plug-in dll will result in 3ds Max loading that plug-in dll automatically. The client of the plug-in instance does not need to explicitly load the plug-in dll. For more details on plug-in defer loading see the topic called "Defer loading of plug-ins" in the 3ds Max SDK Programmer's Guide.

CoreExport int LoadDlls (const MCHAR *pluginWildcard, bool forceLoadDeferrablePluginDlls=false)
 Loads the specified plug-in dlls from all the plug-in folders that 3ds Max knows about. More...
 
CoreExport int LoadDllsFromDir (const MCHAR *pluginPath, const MCHAR *pluginWildcard, bool forceLoadDeferrablePluginDlls=false)
 Loads plug-in DLLs from the specified directory. More...
 
CoreExport bool LoadADll (const MCHAR *pluginDllFileName, bool forceLoadDeferrablePluginDlls)
 Loads a given plug-in DLL. More...
 

Static Public Member Functions

static CoreExport DllDirGetInstance ()
 Retrieves the sole instance of class DllDir. 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...
 

Protected Member Functions

 DllDir ()
 
- Protected Member Functions inherited from Noncopyable
 Noncopyable ()
 
 ~Noncopyable ()
 

Protected Attributes

MaxSDK::AutoPtr< DllDirImpl > mImpl
 

Constructor & Destructor Documentation

virtual ~DllDir ( )
pure virtual
DllDir ( )
protected

Member Function Documentation

static CoreExport DllDir& GetInstance ( )
static

Retrieves the sole instance of class DllDir.

CoreExport int Count ( ) const

Returns the number of plug-in DLLs currently loaded.

CoreExport const DllDesc& operator[] ( int  i) const

Returns a reference to the i-th DllDesc that represents a loaded plug-in dll.

Parameters
i- Zero based index of the loaded plug-in dll descriptors
CoreExport const DllDesc& GetDllDescription ( int  i) const

Returns a reference to the i-th DllDesc that represents a loaded plug-in dll.

Parameters
i- Zero based index of the loaded plug-in dll descriptors
CoreExport int LoadDlls ( const MCHAR pluginWildcard,
bool  forceLoadDeferrablePluginDlls = false 
)

Loads the specified plug-in dlls from all the plug-in folders that 3ds Max knows about.

This method loads the specified plug-ins from the "stdplugs" and all the other folders specified in the Configure System Paths > 3rd Party Plug-ins list.

Parameters
pluginWildcard- String that specifies via wildcard characters (* and ?) which plug-in dlls to load.
forceLoadDeferrablePluginDlls- If true the plug-in dll is guaranteed not to be defer loaded, otherwise the loading of the plug-in dll might be deferred to a later time. For more information see the topic called "Defer loading of plug-ins" in the 3ds Max SDK Programmer's Guide
Returns
Nonzero if successful; zero on error.
CoreExport int LoadDllsFromDir ( const MCHAR pluginPath,
const MCHAR pluginWildcard,
bool  forceLoadDeferrablePluginDlls = false 
)

Loads plug-in DLLs from the specified directory.

The default behaviour of this method is to defer the loading of a plug-in if possible.

Parameters
pluginPath- String that specifies a valid path to load plug-in DLLs from.
pluginWildcard- String that specifies via wildcard characters (* and ?) which plug-in dlls to load.
forceLoadDeferrablePluginDlls- If true the plug-in dll is guaranteed not to be defer loaded, otherwise the loading of the plug-in dll might be deferred to a later time. For more information see the topic called "Defer loading of plug-ins" in the 3ds Max SDK Programmer's Guide
Returns
Nonzero if successful; zero on error.
CoreExport bool LoadADll ( const MCHAR pluginDllFileName,
bool  forceLoadDeferrablePluginDlls 
)

Loads a given plug-in DLL.

Parameters
pluginDllFileName- The path and name of the plug-in dll to load
forceLoadDeferrablePluginDlls- If true the plug-in dll is guaranteed not to be defer loaded, otherwise the loading of the plug-in dll might be deferred to a later time. For more information see the topic called "Defer loading of plug-ins" in the 3ds Max SDK Programmer's Guide
Returns
- true if the plug-in was loaded successfully
CoreExport ClassDirectory& ClassDir ( ) const

Returns a reference to the ClassDirectory.

CoreExport const DllDesc* GetDllDescriptionForClass ( SClass_ID  superClassId,
const Class_ID classId 
)

Returns the DllDesc that contains the definition of a class with the specified class and superclass IDs.

Parameters
superClassIdThe super class ID.
classIdThe class ID.
Returns
The DllDesc object that owns the ClassDesc associated with this ID pairing, or NULL if no such DllDesc exists.
CoreExport int FindDllDescFromDllPath ( const MaxSDK::Util::Path aFullPath) const

Returns the DllDesc index within the DLL Directory (DllDir) for a given full path.

Parameters
aFullPathA fully-qualified path object to the dll represented by the desired DllDesc object
Returns
the index to the DllDesc or -1 if not found
CoreExport int FindDllDescFromHInstance ( const HINSTANCE  hInst) const

Returns the DllDesc index within the DLL Directory (DllDir) for a given module handle.

Parameters
hInstThe module handle used to identify a DllDesc
Returns
the index to the DllDesc or -1 if not found

Member Data Documentation

MaxSDK::AutoPtr<DllDirImpl> mImpl
protected