dllmain.cpp 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: /Commando/Code/Tools/ViewTrans/dllmain.cpp 2 1/16/98 5:02p Greg_h $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Matrix Viewer Utility *
  24. * *
  25. * File Name : DLLMAIN.CPP *
  26. * *
  27. * Programmer : Greg Hjelstrom *
  28. * *
  29. * Start Date : 02/25/97 *
  30. * *
  31. * Last Update : February 25, 1997 [GH] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * DllMain -- Windows DLL initialization *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #include <Max.h>
  38. #include "viewtrans.h"
  39. /*
  40. ** Globals
  41. */
  42. int controlsInit = FALSE;
  43. /***********************************************************************************************
  44. * DllMain -- Windows DLL initialization *
  45. * *
  46. * This function is called by Windows when the DLL is loaded. This *
  47. * function may also be called many times during time critical operations *
  48. * like rendering. Therefore developers need to be careful what they *
  49. * do inside this function. In the code below, note how after the DLL is *
  50. * loaded the first time only a few statements are executed. *
  51. * *
  52. * INPUT: *
  53. * *
  54. * OUTPUT: *
  55. * *
  56. * WARNINGS: *
  57. * *
  58. * HISTORY: *
  59. * 02/25/1997 GH : Created. *
  60. *=============================================================================================*/
  61. BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
  62. {
  63. // Hang on to this DLL's instance handle.
  64. hInstance = hinstDLL;
  65. if (! controlsInit) {
  66. controlsInit = TRUE;
  67. // Initialize MAX's custom controls
  68. InitCustomControls(hInstance);
  69. // Initialize Win95 controls
  70. InitCommonControls();
  71. }
  72. return(TRUE);
  73. }
  74. __declspec(dllexport) const TCHAR *
  75. LibDescription() { return _T("Transformation Matrix Viewer"); }
  76. __declspec(dllexport) int
  77. LibNumberClasses() { return 1; }
  78. __declspec(dllexport) ClassDesc*
  79. LibClassDesc(int i) { return &UtilityDesc; }
  80. __declspec(dllexport) ULONG
  81. LibVersion() { return VERSION_3DSMAX; }