WWCtrl.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. // WWCtrl.cpp : Defines the initialization routines for the DLL.
  19. //
  20. #include "stdafx.h"
  21. #include <afxdllx.h>
  22. #include "WWCtrl.H"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. //
  30. // Declarations
  31. //
  32. extern void RegisterColorPicker (HINSTANCE hinst);
  33. extern void RegisterColorBar (HINSTANCE hinst);
  34. HINSTANCE _hinstance = NULL;
  35. static AFX_EXTENSION_MODULE WWCtrlDLL = { NULL, NULL };
  36. /////////////////////////////////////////////////////////////
  37. //
  38. // DllMain
  39. //
  40. /////////////////////////////////////////////////////////////
  41. extern "C" int APIENTRY
  42. DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  43. {
  44. // Remove this if you use lpReserved
  45. UNREFERENCED_PARAMETER(lpReserved);
  46. if (dwReason == DLL_PROCESS_ATTACH)
  47. {
  48. TRACE0("WWCTRL.DLL Initializing!\n");
  49. _hinstance = hInstance;
  50. // Extension DLL one-time initialization
  51. if (!AfxInitExtensionModule(WWCtrlDLL, hInstance))
  52. return 0;
  53. // Insert this DLL into the resource chain
  54. // NOTE: If this Extension DLL is being implicitly linked to by
  55. // an MFC Regular DLL (such as an ActiveX Control)
  56. // instead of an MFC application, then you will want to
  57. // remove this line from DllMain and put it in a separate
  58. // function exported from this Extension DLL. The Regular DLL
  59. // that uses this Extension DLL should then explicitly call that
  60. // function to initialize this Extension DLL. Otherwise,
  61. // the CDynLinkLibrary object will not be attached to the
  62. // Regular DLL's resource chain, and serious problems will
  63. // result.
  64. RegisterColorPicker (hInstance);
  65. RegisterColorBar (hInstance);
  66. new CDynLinkLibrary(WWCtrlDLL);
  67. }
  68. else if (dwReason == DLL_PROCESS_DETACH)
  69. {
  70. TRACE0("WWCTRL.DLL Terminating!\n");
  71. // Terminate the library before destructors are called
  72. AfxTermExtensionModule(WWCtrlDLL);
  73. }
  74. return 1; // ok
  75. }
  76. /////////////////////////////////////////////////////////////
  77. //
  78. // Initialize_WWCtrl
  79. //
  80. /////////////////////////////////////////////////////////////
  81. __declspec (dllexport) void
  82. Initialize_WWCtrl (void)
  83. {
  84. return ;
  85. }