Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.4 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. /////////////////////////////////////////////////////////////////////////////
  11. // AFXDLLX.H: Extra header for building an MFC Extension DLL
  12. //
  13. // This file is really a source file that you should include in the
  14. // main source file of your DLL. It must only be included once, and
  15. // not multiple times (you will get linker errors if it is included
  16. // multiple times). If you do not use _AFXEXT, it is not required
  17. // but you may want the feature it provides.
  18. //
  19. // Previous versions of 32-bit MFC did not require this file. This version
  20. // requires this file to support dynamic loading of extension DLLs. In
  21. // other words, if your application does LoadLibrary on any extension
  22. // DLL (instead of binding to the DLL at link time), this file is
  23. // required.
  24. #ifdef _AFX_MINREBUILD
  25. #pragma component(minrebuild, off)
  26. #endif
  27. #ifndef _AFX_FULLTYPEINFO
  28. #pragma component(mintypeinfo, on)
  29. #endif
  30. // The following symbol used to force inclusion of this module for _AFXEXT
  31. #if defined(_X86_)
  32. extern "C" { int _afxForceEXTDLL; }
  33. #else
  34. extern "C" { int __afxForceEXTDLL; }
  35. #endif
  36. /////////////////////////////////////////////////////////////////////////////
  37. // RawDllMain that saves current app class list and factory list
  38. extern "C" BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID);
  39. extern "C" BOOL (WINAPI* _pRawDllMain)(HINSTANCE, DWORD, LPVOID) = &ExtRawDllMain;
  40. extern "C"
  41. BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID)
  42. {
  43. if (dwReason == DLL_PROCESS_ATTACH)
  44. {
  45. // save critical data pointers before running the constructors
  46. AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
  47. pModuleState->m_pClassInit = pModuleState->m_classList;
  48. pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
  49. pModuleState->m_classList.m_pHead = NULL;
  50. pModuleState->m_factoryList.m_pHead = NULL;
  51. }
  52. return TRUE; // ok
  53. }
  54. #ifdef _AFX_MINREBUILD
  55. #pragma component(minrebuild, on)
  56. #endif
  57. #ifndef _AFX_FULLTYPEINFO
  58. #pragma component(mintypeinfo, off)
  59. #endif
  60. /////////////////////////////////////////////////////////////////////////////