Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

DllEntry.cpp

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003         FILE: DllEntry.cpp
00004 
00005         DESCRIPTION: Contains the Dll Entry stuff
00006 
00007         CREATED BY: 
00008 
00009         HISTORY: 
00010 
00011  *>     Copyright (c) 2003, All Rights Reserved.
00012  **********************************************************************/
00013 #include "pcggui.h"
00014 
00015 extern ClassDesc2* GetpcgguiDesc();
00016 
00017 HINSTANCE hInstance;
00018 int controlsInit = FALSE;
00019 
00020 // This function is called by Windows when the DLL is loaded.  This 
00021 // function may also be called many times during time critical operations
00022 // like rendering.  Therefore developers need to be careful what they
00023 // do inside this function.  In the code below, note how after the DLL is
00024 // loaded the first time only a few statements are executed.
00025 
00026 BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
00027 {
00028         hInstance = hinstDLL;                           // Hang on to this DLL's instance handle.
00029 
00030         if (!controlsInit) {
00031                 controlsInit = TRUE;
00032                 InitCustomControls(hInstance);  // Initialize MAX's custom controls
00033                 InitCommonControls();                   // Initialize Win95 controls
00034         }
00035                         
00036         return (TRUE);
00037 }
00038 
00039 // This function returns a string that describes the DLL and where the user
00040 // could purchase the DLL if they don't have it.
00041 __declspec( dllexport ) const TCHAR* LibDescription()
00042 {
00043         return GetString(IDS_LIBDESCRIPTION);
00044 }
00045 
00046 // This function returns the number of plug-in classes this DLL
00047 //TODO: Must change this number when adding a new class
00048 __declspec( dllexport ) int LibNumberClasses()
00049 {
00050         return 1;
00051 }
00052 
00053 // This function returns the number of plug-in classes this DLL
00054 __declspec( dllexport ) ClassDesc* LibClassDesc(int i)
00055 {
00056         switch(i) {
00057                 case 0: return GetpcgguiDesc();
00058                 default: return 0;
00059         }
00060 }
00061 
00062 // This function returns a pre-defined constant indicating the version of 
00063 // the system under which it was compiled.  It is used to allow the system
00064 // to catch obsolete DLLs.
00065 __declspec( dllexport ) ULONG LibVersion()
00066 {
00067         return VERSION_3DSMAX;
00068 }
00069 
00070 TCHAR *GetString(int id)
00071 {
00072         static TCHAR buf[256];
00073 
00074         if (hInstance)
00075                 return LoadString(hInstance, id, buf, sizeof(buf)) ? buf : NULL;
00076         return NULL;
00077 }
00078 

Generated on Tue Apr 17 09:39:11 2007 for PCG Library by  doxygen 1.3.9.1