home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / atltangram / atlmodel / stdafx.h < prev   
C/C++ Source or Header  |  1998-03-26  |  2KB  |  65 lines

  1. // stdafx.h : include file for standard system include files,
  2. //      or project specific include files that are used frequently,
  3. //      but are changed infrequently
  4. //
  5. // This is a part of the Active Template Library.
  6. // Copyright (C) 1996-1998 Microsoft Corporation
  7. // All rights reserved.
  8. //
  9. // This source code is only intended as a supplement to the
  10. // Active Template Library Reference and related
  11. // electronic documentation provided with the library.
  12. // See these sources for detailed information regarding the
  13. // Active Template Library product.
  14.  
  15. #if !defined(AFX_STDAFX_H__060BAA99_B076_11D0_B69F_00A0C903487A__INCLUDED_)
  16. #define AFX_STDAFX_H__060BAA99_B076_11D0_B69F_00A0C903487A__INCLUDED_
  17.  
  18. #if _MSC_VER >= 1000
  19. #pragma once
  20. #endif // _MSC_VER >= 1000
  21.  
  22. #define STRICT
  23.  
  24.  
  25. #define _WIN32_WINNT 0x0400
  26. #define _ATL_APARTMENT_THREADED
  27.  
  28.  
  29. #include <atlbase.h>
  30. //You may derive a class from CComModule and use it if you want to override
  31. //something, but do not change the name of _Module
  32.  
  33. class CExeModule : public CComModule
  34. {
  35. public:
  36.     LONG Unlock()
  37.     {
  38.         LONG l = CComModule::Unlock();
  39.         if (l == 0)
  40.         {
  41.     #if _WIN32_WINNT >= 0x0400
  42.             if (CoSuspendClassObjects() == S_OK)
  43.                 PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
  44.     #else
  45.             PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
  46.     #endif
  47.         }
  48.         return l;
  49.     }
  50.  
  51.     DWORD dwThreadID;
  52. };
  53.  
  54. #ifndef _LOCAL_SERVER
  55. extern CComModule _Module;
  56. #else
  57. extern CExeModule _Module;
  58. #endif
  59. #include <atlcom.h>
  60.  
  61. //{{AFX_INSERT_LOCATION}}
  62. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  63.  
  64. #endif // !defined(AFX_STDAFX_H__060BAA99_B076_11D0_B69F_00A0C903487A__INCLUDED)
  65.