XMLGUI.cpp
上传用户:kj0090
上传日期:2007-03-02
资源大小:39k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

C/C++

  1. // XMLGUI.cpp : Defines the initialization routines for the DLL.
  2. //
  3. #include "stdafx.h"
  4. #include <afxdllx.h>
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. static AFX_EXTENSION_MODULE XMLGUIDLL = { NULL, NULL };
  11. extern "C" int APIENTRY
  12. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  13. {
  14. // Remove this if you use lpReserved
  15. UNREFERENCED_PARAMETER(lpReserved);
  16. if (dwReason == DLL_PROCESS_ATTACH)
  17. {
  18. TRACE0("XMLGUI.DLL Initializing!n");
  19. // Extension DLL one-time initialization
  20. if (!AfxInitExtensionModule(XMLGUIDLL, hInstance))
  21. return 0;
  22. // Insert this DLL into the resource chain
  23. // NOTE: If this Extension DLL is being implicitly linked to by
  24. //  an MFC Regular DLL (such as an ActiveX Control)
  25. //  instead of an MFC application, then you will want to
  26. //  remove this line from DllMain and put it in a separate
  27. //  function exported from this Extension DLL.  The Regular DLL
  28. //  that uses this Extension DLL should then explicitly call that
  29. //  function to initialize this Extension DLL.  Otherwise,
  30. //  the CDynLinkLibrary object will not be attached to the
  31. //  Regular DLL's resource chain, and serious problems will
  32. //  result.
  33. new CDynLinkLibrary(XMLGUIDLL);
  34. }
  35. else if (dwReason == DLL_PROCESS_DETACH)
  36. {
  37. TRACE0("XMLGUI.DLL Terminating!n");
  38. // Terminate the library before destructors are called
  39. AfxTermExtensionModule(XMLGUIDLL);
  40. }
  41. return 1;   // ok
  42. }