Public Member Functions | Static Public Member Functions

DllDesc Class Reference

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


Search for all occurrences

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 and Class Descriptors
Deferred Loading of Plugins

#include <plugin.h>

Inheritance diagram for DllDesc:
Inheritance graph
[legend]

List of all members.

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.
CoreExport const MCHAR *  Description () const
  Returns the Description defined in the LibDescription function.
CoreExport int  NumberOfClasses () const
  Returns the number of classes implemented in the DLL.
CoreExport ClassDesc operator[] (int i) const
  Returns a pointer to the 'i-th' class descriptor.
CoreExport ClassDesc GetClassDesc (int i) const
  Returns a pointer to the 'i-th' class descriptor.
CoreExport int  operator== (const DllDesc &dd) const
  Equality operator.
CoreExport bool  HasRttiSupport () const
  Checks if this plugins dll was built with run-time type information (RTTI).
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.
CoreExport ULONG  GetVersion () const
  Returns the value reported by the LibVersion() function implemented by the plug-in DLL.
CoreExport bool  IsDeferrable () const
  Returns whether the corresponding plug-in DLL can be defer loaded or not.
CoreExport bool  ImplementsCanAutoDefer () const
  Returns whether the corresponding plug-in DLL implements the CanAutoDefer function or not.
CoreExport const MSTR GetFullPath () const
  Returns the full path of the plug-in DLL file this instance of DllDesc represents.
CoreExport const MSTR GetFileName () const
  Returns the file name and extension of the plug-in DLL this instance of DllDesc represents.
CoreExport const MSTR GetDirectoryName () const
  Returns the folder name with a trailing backslash of the plug-in DLL this instance of DllDesc represents.
CoreExport const HINSTANCE  GetHandle () const
  Returns the module handle of the plug-in DLL represented by this DllDesc instance.
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.
CoreExport FILETIME  GetTimeLastModified () const
  Returns the date and time the plug-in DLL was last modified.
MAX_DEPRECATED void  Free ()
MAX_DEPRECATED BOOL  Initialize ()
MAX_DEPRECATED BOOL  Shutdown ()
  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.

Constructor & Destructor Documentation

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 ( const MCHAR *  dllFullPath,
const MCHAR *  dllDescription,
const FILETIME &  timeLastWrite 
) [explicit]
DllDesc ( const DllDesc other )
~DllDesc ( )

Member Function Documentation

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.

CoreExport const MCHAR* Description ( ) const

Returns the Description defined in the LibDescription function.

CoreExport int NumberOfClasses ( ) const

Returns the number of classes implemented in the DLL.

This is the value returned by the library function LibNumberClasses.

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.
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.
CoreExport int operator== ( const DllDesc dd ) const

Equality operator.

Always returns zero.

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

CoreExport ULONG GetVersion ( ) const

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

CoreExport bool IsDeferrable ( ) const

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

CoreExport bool ImplementsCanAutoDefer ( ) const

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

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:
pluginDllVersion The 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.
CoreExport const MSTR& GetFullPath ( ) const

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

CoreExport const MSTR& GetFileName ( ) const

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

CoreExport const MSTR& GetDirectoryName ( ) const

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

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.

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.

CoreExport FILETIME GetTimeLastModified ( ) const

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

MAX_DEPRECATED void Free ( )
Deprecated:
Deprecated in 3ds Max 2012 and there's no replacement for it.

DllDesc::Free() was effectively unloading the plug-in DLL which is currently not supported. Decrements the reference count of the plug-in DLL. When the reference count reaches zero, the module is unmapped from the address space of the calling process.

MAX_DEPRECATED BOOL Initialize ( )
Deprecated:
Deprecated in 3ds Max 2012 and there's no replacement for it.

A plug-in's LibInitialize method should be called only once by 3ds Max as part of the plug-in's loading process.

MAX_DEPRECATED BOOL Shutdown ( )
Deprecated:
Deprecated in 3ds Max 2012 and there's no replacement for it.

A plug-in's LibShutdown method should be called only once by 3ds Max as part of the plug-in's unloading process.

void Unload ( )
BOOL CallInitialize ( )
BOOL CallShutdown ( )
DllDesc operator= ( const DllDesc other )

DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc
DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc DllDesc