Leaked source code of windows server 2003
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.

80 lines
1.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1999
  5. //
  6. // File: atlconui.h
  7. //
  8. // Contents: Support for ATL in an MFC project
  9. //
  10. // History: 15-Aug-99 VivekJ Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #include <atlbase.h>
  14. // We can implement the MFC/ATL lock count interaction in two different ways
  15. // (you may comment/uncomment the one you want to try)
  16. // ATL can blindly delegate all the ATL Lock()/Unlock() calls to MFC
  17. /*
  18. class CAtlGlobalModule : public CComModule
  19. {
  20. public:
  21. LONG Lock()
  22. {
  23. AfxOleLockApp();
  24. return 0;
  25. }
  26. LONG Unlock()
  27. {
  28. AfxOleUnlockApp();
  29. return 0;
  30. }
  31. };
  32. */
  33. #ifdef DBG
  34. extern CTraceTag tagATLLock;
  35. #endif
  36. class CAtlGlobalModule : public CComModule
  37. {
  38. public:
  39. LONG Lock()
  40. {
  41. LONG l = CComModule::Lock();
  42. Trace(tagATLLock, TEXT("Lock: count = %d"), l);
  43. return l;
  44. }
  45. LONG Unlock()
  46. {
  47. LONG l = CComModule::Unlock();
  48. Trace(tagATLLock, TEXT("Unlock: count = %d"), l);
  49. return l;
  50. }
  51. };
  52. //You may derive a class from CComModule and use it if you want to override
  53. //something, but do not change the name of _Module
  54. extern CAtlGlobalModule _Module;
  55. #include <atlcom.h>
  56. // Needed because MFC creates a macro for this which ATL doesn't like.
  57. #undef SubclassWindow
  58. #undef WM_OCC_LOADFROMSTREAM
  59. #undef WM_OCC_LOADFROMSTORAGE
  60. #undef WM_OCC_INITNEW
  61. #undef WM_OCC_LOADFROMSTREAM_EX
  62. #undef WM_OCC_LOADFROMSTORAGE_EX
  63. // This prevents the ATL activeX host from locking the app.
  64. #define _ATL_HOST_NOLOCK
  65. #include <atlcom.h>
  66. #include <atlwin.h>
  67. #include <atlhost.h>
  68. #include <atlctl.h>
  69. #include <sitebase.h>
  70. #include <axhostwindow2.h>