DllEntry.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. /**********************************************************************
  19. *<
  20. FILE: DllEntry.cpp
  21. DESCRIPTION:Contains the Dll Entry stuff
  22. CREATED BY:
  23. HISTORY:
  24. *> Copyright (c) 1997, All Rights Reserved.
  25. **********************************************************************/
  26. #include "MaxFly.h"
  27. extern ClassDesc2* GetMaxFlyDesc();
  28. HINSTANCE hInstance;
  29. int controlsInit = FALSE;
  30. BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
  31. {
  32. hInstance = hinstDLL; // Hang on to this DLL's instance handle.
  33. if (!controlsInit) {
  34. controlsInit = TRUE;
  35. InitCustomControls(hInstance); // Initialize MAX's custom controls
  36. InitCommonControls(); // Initialize Win95 controls
  37. }
  38. return (TRUE);
  39. }
  40. __declspec( dllexport ) const TCHAR* LibDescription()
  41. {
  42. return GetString(IDS_LIBDESCRIPTION);
  43. }
  44. //TODO: Must change this number when adding a new class
  45. __declspec( dllexport ) int LibNumberClasses()
  46. {
  47. return 1;
  48. }
  49. __declspec( dllexport ) ClassDesc* LibClassDesc(int i)
  50. {
  51. switch(i) {
  52. case 0: return GetMaxFlyDesc();
  53. default: return 0;
  54. }
  55. }
  56. __declspec( dllexport ) ULONG LibVersion()
  57. {
  58. return VERSION_3DSMAX;
  59. }
  60. TCHAR *GetString(int id)
  61. {
  62. static TCHAR buf[256];
  63. if (hInstance)
  64. return LoadString(hInstance, id, buf, sizeof(buf)) ? buf : NULL;
  65. return NULL;
  66. }