Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

DllDir Class Reference

This reference page is linked to from the following overview topics: Incremental Improvements.


Search for all occurrences

Detailed 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.

#include <plugin.h>

Inheritance diagram for DllDir:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~DllDir ()=0
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.
CoreExport const DllDesc GetDllDescription (int i) const
  Returns a reference to the i-th DllDesc that represents a loaded plug-in dll.
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.
CoreExport int  FindDllDescFromDllPath (const MaxSDK::Util::Path &aFullPath) const
  Returns the DllDesc index within the DLL Directory (DllDir) for a given full path.
CoreExport int  FindDllDescFromHInstance (const HINSTANCE hInst) const
  Returns the DllDesc index within the DLL Directory (DllDir) for a given module handle.
MAX_DEPRECATED void  UnloadAllDlls ()
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.
CoreExport int  LoadDllsFromDir (const MCHAR *pluginPath, const MCHAR *pluginWildcard, bool forceLoadDeferrablePluginDlls=false)
  Loads plug-in DLLs from the specified directory.
CoreExport bool  LoadADll (const MCHAR *pluginDllFileName, bool forceLoadDeferrablePluginDlls)
  Loads a given plug-in DLL.

Static Public Member Functions

static CoreExport DllDir GetInstance ()
  Retrieves the sole instance of class DllDir.

Protected Member Functions

  DllDir ()

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:
superClassId The super class ID.
classId The 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:
aFullPath A 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:
hInst The module handle used to identify a DllDesc
Returns:
the index to the DllDesc or -1 if not found
MAX_DEPRECATED void UnloadAllDlls ( )
Deprecated:
Deprecated as of 3ds Max 2012.

Unloading plug-in DLLs is not safe and therefore not supported.


Member Data Documentation

MaxSDK::AutoPtr<DllDirImpl> mImpl [protected]

DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir
DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir DllDir