home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / ATL / include / Atldef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  3.9 KB  |  130 lines

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10.  
  11. #ifndef __ATLDEF_H__
  12. #define __ATLDEF_H__
  13.  
  14. #ifndef __cplusplus
  15.     #error ATL requires C++ compilation (use a .cpp suffix)
  16. #endif
  17.  
  18. #ifdef _UNICODE
  19. #ifndef UNICODE
  20. #define UNICODE         // UNICODE is used by Windows headers
  21. #endif
  22. #endif
  23.  
  24. #ifdef UNICODE
  25. #ifndef _UNICODE
  26. #define _UNICODE        // _UNICODE is used by C-runtime/MFC headers
  27. #endif
  28. #endif
  29.  
  30. #ifdef _DEBUG
  31. #ifndef DEBUG
  32. #define DEBUG
  33. #endif
  34. #endif
  35.  
  36. #ifndef ATLASSERT
  37. #define ATLASSERT(expr) _ASSERTE(expr)
  38. #endif
  39.  
  40. ///////////////////////////////////////////////////////////////////////////////
  41. // __declspec(novtable) is used on a class declaration to prevent the vtable
  42. // pointer from being initialized in the constructor and destructor for the
  43. // class.  This has many benefits because the linker can now eliminate the
  44. // vtable and all the functions pointed to by the vtable.  Also, the actual
  45. // constructor and destructor code are now smaller.
  46. ///////////////////////////////////////////////////////////////////////////////
  47. // This should only be used on a class that is not directly createable but is
  48. // rather only used as a base class.  Additionally, the constructor and
  49. // destructor (if provided by the user) should not call anything that may cause
  50. // a virtual function call to occur back on the object.
  51. ///////////////////////////////////////////////////////////////////////////////
  52. // By default, the wizards will generate new ATL object classes with this
  53. // attribute (through the ATL_NO_VTABLE macro).  This is normally safe as long
  54. // the restriction mentioned above is followed.  It is always safe to remove
  55. // this macro from your class, so if in doubt, remove it.
  56. ///////////////////////////////////////////////////////////////////////////////
  57.  
  58. #ifdef _ATL_DISABLE_NO_VTABLE
  59. #define ATL_NO_VTABLE
  60. #else
  61. #define ATL_NO_VTABLE __declspec(novtable)
  62. #endif
  63.  
  64. #ifdef _ATL_DEBUG_REFCOUNT
  65. #ifndef _ATL_DEBUG_INTERFACES
  66. #define _ATL_DEBUG_INTERFACES
  67. #endif
  68. #endif
  69.  
  70. #ifdef _ATL_DEBUG_INTERFACES
  71. #ifndef _ATL_DEBUG
  72. #define _ATL_DEBUG
  73. #endif // _ATL_DEBUG
  74. #endif // _ATL_DEBUG_INTERFACES
  75.  
  76. #ifndef _ATL_HEAPFLAGS
  77. #ifdef _MALLOC_ZEROINIT
  78. #define _ATL_HEAPFLAGS HEAP_ZERO_MEMORY
  79. #else
  80. #define _ATL_HEAPFLAGS 0
  81. #endif
  82. #endif
  83.  
  84. #ifndef _ATL_PACKING
  85. #define _ATL_PACKING 8
  86. #endif
  87.  
  88. #if defined(_ATL_DLL)
  89.     #define ATLAPI extern "C" HRESULT __declspec(dllimport) __stdcall
  90.     #define ATLAPI_(x) extern "C" __declspec(dllimport) x __stdcall
  91.     #define ATLINLINE
  92. #elif defined(_ATL_DLL_IMPL)
  93.     #define ATLAPI extern "C" HRESULT __declspec(dllexport) __stdcall
  94.     #define ATLAPI_(x) extern "C" __declspec(dllexport) x __stdcall
  95.     #define ATLINLINE
  96. #else
  97.     #define ATLAPI HRESULT __stdcall
  98.     #define ATLAPI_(x) x __stdcall
  99.     #define ATLINLINE inline
  100. #endif
  101.  
  102. #if defined (_CPPUNWIND) & (defined(_ATL_EXCEPTIONS) | defined(_AFX))
  103. #define ATLTRY(x) try{x;} catch(...) {}
  104. #else
  105. #define ATLTRY(x) x;
  106. #endif
  107.  
  108. #define offsetofclass(base, derived) ((DWORD)(static_cast<base*>((derived*)_ATL_PACKING))-_ATL_PACKING)
  109.  
  110. /////////////////////////////////////////////////////////////////////////////
  111. // Master version numbers
  112.  
  113. #define _ATL     1      // Active Template Library
  114. #define _ATL_VER 0x0300 // Active Template Library version 3.0
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // Threading
  118.  
  119. #ifndef _ATL_SINGLE_THREADED
  120. #ifndef _ATL_APARTMENT_THREADED
  121. #ifndef _ATL_FREE_THREADED
  122. #define _ATL_FREE_THREADED
  123. #endif
  124. #endif
  125. #endif
  126.  
  127. #endif // __ATLDEF_H__
  128.  
  129. /////////////////////////////////////////////////////////////////////////////
  130.