stdafx.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. // STDAFX.H is the header that includes the standard includes that are used
  11. // for most of the project. These are compiled into a pre-compiled header
  12. // turn off warnings for /W4 (just for MFC implementation)
  13. #ifndef ALL_WARNINGS
  14. #pragma warning(disable: 4073) // disable warning about using init_seg
  15. #endif
  16. // MFC inline constructors (including compiler generated) can get deep
  17. #pragma inline_depth(16)
  18. #ifdef _AFX_DEVBUILD
  19. #define AFX_IMPL_DATA AFX_DATA_EXPORT
  20. #else
  21. #define AFX_IMPL_DATA
  22. #endif
  23. // override default values for data import/export when building MFC DLLs
  24. #ifdef _AFX_CORE_IMPL
  25. #define AFX_CORE_DATA AFX_IMPL_DATA
  26. #define AFX_CORE_DATADEF
  27. #endif
  28. #ifdef _AFX_OLE_IMPL
  29. #define AFX_OLE_DATA AFX_IMPL_DATA
  30. #define AFX_OLE_DATADEF
  31. #endif
  32. #ifdef _AFX_DB_IMPL
  33. #define AFX_DB_DATA AFX_IMPL_DATA
  34. #define AFX_DB_DATADEF
  35. #endif
  36. #ifdef _AFX_NET_IMPL
  37. #define AFX_NET_DATA AFX_IMPL_DATA
  38. #define AFX_NET_DATADEF
  39. #endif
  40. #define _AFX_NOFORCE_LIBS
  41. #define _AFX_FULLTYPEINFO
  42. #define VC_EXTRALEAN
  43. #define NO_ANSIUNI_ONLY
  44. #define _MFC_OVERRIDES_NEW
  45. #define AFX_COMDAT __declspec(selectany)
  46. // core headers
  47. #include "afx.h"
  48. #include "afxplex_.h"
  49. #include "afxcoll.h"
  50. // public headers
  51. #include "afxwin.h"
  52. #include "afxdlgs.h"
  53. #include "afxext.h"
  54. #ifndef _AFX_NO_OLEDB_SUPPORT
  55. #include "atlbase.h"
  56. #endif
  57. #ifndef _AFX_NO_OLE_SUPPORT
  58. #ifndef _OLE2_H_
  59. #include <ole2.h>
  60. #endif
  61. #include <winspool.h>
  62. // include OLE dialog/helper APIs
  63. #ifndef _OLEDLG_H_
  64. #include <oledlg.h>
  65. #endif
  66. #include <winreg.h>
  67. #include "afxcom_.h"
  68. #include "afxole.h"
  69. #include "afxdtctl.h"
  70. #include "afxdocob.h"
  71. #ifndef _AFX_NO_DAO_SUPPORT
  72. #include "afxdao.h"
  73. #endif
  74. #include "afxodlgs.h"
  75. #endif
  76. #ifndef _AFX_NO_OCX_SUPPORT
  77. #include "afxctl.h"
  78. #endif
  79. #ifndef _AFX_NO_DB_SUPPORT
  80. #include "afxdb.h"
  81. #endif
  82. #ifndef _AFX_NO_SYNC_SUPPORT
  83. #include "afxmt.h"
  84. #endif
  85. #ifndef _AFX_NO_INET_SUPPORT
  86. #include "afxinet.h"
  87. #endif
  88. // private headers as well
  89. #include "afxpriv.h"
  90. #include "afximpl.h"
  91. #include "winhand_.h"
  92. #ifndef _AFX_NO_OLE_SUPPORT
  93. #include "oleimpl2.h"
  94. #endif
  95. #ifndef _AFX_NO_OCX_SUPPORT
  96. #include "ctlimpl.h"
  97. #endif
  98. #ifndef _AFX_NO_DB_SUPPORT
  99. #include "dbimpl.h"
  100. #endif
  101. #ifndef _AFX_NO_DAO_SUPPORT
  102. #include "daoimpl.h"
  103. #endif
  104. #ifndef _AFX_NO_SOCKET_SUPPORT
  105. #ifndef _WINSOCKAPI_
  106. #include <winsock.h>
  107. #endif
  108. #include "sockimpl.h"
  109. #include "afxsock.h"
  110. #endif
  111. #ifndef _AFX_NO_AFXCMN_SUPPORT
  112. #include "afxcmn.h"
  113. #include "afxcview.h"
  114. #endif
  115. #ifndef _AFX_NO_RICHEDIT_SUPPORT
  116. #include "afxrich.h"
  117. #endif
  118. #ifndef _AFX_NO_DHTML_SUPPORT
  119. #include "afxhtml.h"
  120. #endif
  121. #include <winreg.h>
  122. #include <winnls.h>
  123. #include <stddef.h>
  124. #include <limits.h>
  125. #include <malloc.h>
  126. #include <new.h>
  127. #ifndef _AFX_OLD_EXCEPTIONS
  128. #include <eh.h> // for set_terminate
  129. #endif
  130. #undef AfxWndProc
  131. // implementation uses _AFX_PACKING as well
  132. #ifdef _AFX_PACKING
  133. #ifndef ALL_WARNINGS
  134. #pragma warning(disable: 4103)
  135. #endif
  136. #ifndef __BORLANDC__
  137. // In Borland C++ we set the packing to 4 in the BCC32.CFG file
  138. // This is because the inclusion of the following pragma line disables our
  139. // Pre-Compiled-Headers
  140. #pragma pack(_AFX_PACKING)
  141. #endif // __BORLANDC__
  142. #endif
  143. // special exception handling just for MFC library implementation
  144. #ifndef _AFX_OLD_EXCEPTIONS
  145. // MFC does not rely on auto-delete semantics of the TRY..CATCH macros,
  146. // therefore those macros are mapped to something closer to the native
  147. // C++ exception handling mechanism when building MFC itself.
  148. #undef TRY
  149. #define TRY { try {
  150. #undef CATCH
  151. #define CATCH(class, e) } catch (class* e) \
  152. { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  153. #undef AND_CATCH
  154. #define AND_CATCH(class, e) } catch (class* e) \
  155. { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  156. #undef CATCH_ALL
  157. #define CATCH_ALL(e) } catch (CException* e) \
  158. { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  159. #undef AND_CATCH_ALL
  160. #define AND_CATCH_ALL(e) } catch (CException* e) \
  161. { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  162. #undef END_TRY
  163. #define END_TRY } catch (CException* e) \
  164. { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); e->Delete(); } }
  165. #undef THROW_LAST
  166. #define THROW_LAST() throw
  167. // Because of the above definitions of TRY...CATCH it is necessary to
  168. // explicitly delete exception objects at the catch site.
  169. #define DELETE_EXCEPTION(e) do { e->Delete(); } while (0)
  170. #define NO_CPP_EXCEPTION(expr)
  171. #else //!_AFX_OLD_EXCEPTIONS
  172. // In this case, the TRY..CATCH macros provide auto-delete semantics, so
  173. // it is not necessary to explicitly delete exception objects at the catch site.
  174. #define DELETE_EXCEPTION(e)
  175. #define NO_CPP_EXCEPTION(expr) expr
  176. #endif //_AFX_OLD_EXCEPTIONS
  177. #define min std::min
  178. #define max std::max
  179. /////////////////////////////////////////////////////////////////////////////