home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / appwiz / hierwiz / hierwiz.cpp < prev    next >
C/C++ Source or Header  |  1998-03-05  |  1KB  |  49 lines

  1. // hierwiz.cpp : Defines the initialization routines for the DLL.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "hierwiz.h"
  15. #include "hierwaw.h"
  16.  
  17. #ifdef _PSEUDO_DEBUG
  18. #undef THIS_FILE
  19. static char BASED_CODE THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. static AFX_EXTENSION_MODULE hierwizDLL = { NULL, NULL };
  23.  
  24. extern "C" int APIENTRY
  25. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  26. {
  27.     if (dwReason == DLL_PROCESS_ATTACH)
  28.     {
  29.         TRACE0("HIERWIZ.DLL Initializing!\n");
  30.  
  31.         // Extension DLL one-time initialization
  32.         AfxInitExtensionModule(hierwizDLL, hInstance);
  33.  
  34.         // Insert this DLL into the resource chain
  35.         new CDynLinkLibrary(hierwizDLL);
  36.  
  37.         // Register this custom AppWizard with MFCAPWZ.DLL
  38.         SetCustomAppWizClass(&hierwizaw);
  39.     }
  40.     else if (dwReason == DLL_PROCESS_DETACH)
  41.     {
  42.         TRACE0("HIERWIZ.DLL Terminating!\n");
  43.  
  44.         // Terminate the library before destructors are called
  45.         AfxTermExtensionModule(hierwizDLL);
  46.     }
  47.     return 1;   // ok
  48. }
  49.