home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_VC.50 / VC / MFC / SRC / STDAFX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-30  |  5.3 KB  |  218 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1997 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.  
  11. // STDAFX.H is the header that includes the standard includes that are used
  12. //  for most of the project.  These are compiled into a pre-compiled header
  13.  
  14. // turn off warnings for /W4 (just for MFC implementation)
  15. #ifndef ALL_WARNINGS
  16. #pragma warning(disable: 4073)  // disable warning about using init_seg
  17. #ifdef _MAC
  18. #pragma warning(disable: 4121)  // disable (incorrect?) warning about packing of MachineLocation in OSUtils.h
  19. #endif
  20. #endif
  21.  
  22. // MFC inline constructors (including compiler generated) can get deep
  23. #pragma inline_depth(16)
  24.  
  25. // override default values for data import/export when building MFC DLLs
  26. #ifdef _AFX_CORE_IMPL
  27.     #define AFX_CORE_DATA   AFX_DATA_EXPORT
  28.     #define AFX_CORE_DATADEF
  29. #endif
  30.  
  31. #ifdef _AFX_OLE_IMPL
  32.     #define AFX_OLE_DATA    AFX_DATA_EXPORT
  33.     #define AFX_OLE_DATADEF
  34. #endif
  35.  
  36. #ifdef _AFX_DB_IMPL
  37.     #define AFX_DB_DATA     AFX_DATA_EXPORT
  38.     #define AFX_DB_DATADEF
  39. #endif
  40.  
  41. #ifdef _AFX_NET_IMPL
  42.     #define AFX_NET_DATA    AFX_DATA_EXPORT
  43.     #define AFX_NET_DATADEF
  44. #endif
  45.  
  46. #define _AFX_NOFORCE_LIBS
  47. #define _AFX_FULLTYPEINFO
  48. #define VC_EXTRALEAN
  49. #define NO_ANSIUNI_ONLY
  50.  
  51. // include these first so that protected structures in winwlm.h are declared
  52. #ifdef _MAC
  53. #define SystemSevenOrLater 1
  54. #include <macname1.h>
  55. #include <Types.h>
  56. #include <QuickDraw.h>
  57. #include <AppleEvents.h>
  58. #include <macname2.h>
  59. #define NEWOLE
  60. #endif
  61.  
  62. // core headers
  63. #include "afx.h"
  64. #include "afxplex_.h"
  65. #include "afxcoll.h"
  66.  
  67. // public headers
  68. #include "afxwin.h"
  69. #include "afxdlgs.h"
  70. #include "afxext.h"
  71. #ifndef _AFX_NO_OLE_SUPPORT
  72.     #ifndef _OLE2_H_
  73.         #include <ole2.h>
  74.     #endif
  75.  
  76. #include <winspool.h>
  77.  
  78. #ifdef _MAC
  79.     // include OLE dialog/helper APIs
  80.     #include <ole2ui.h>
  81. #else
  82.     // include OLE dialog/helper APIs
  83.     #ifndef _OLEDLG_H_
  84.         #include <oledlg.h>
  85.     #endif
  86. #endif
  87.  
  88.     #include <winreg.h>
  89.         #include "afxcom_.h"
  90.     #include "oleimpl.h"
  91.     #include "afxole.h"
  92. #if !defined(_MAC) || defined(MACOCX)
  93.     #include "afxdocob.h"
  94. #endif
  95.  
  96. #ifndef _AFX_NO_DAO_SUPPORT
  97.     #include "afxdao.h"
  98. #endif
  99.  
  100.     #include "afxodlgs.h"
  101. #endif
  102.  
  103. #ifndef _AFX_NO_OCX_SUPPORT
  104.     #include "afxctl.h"
  105. #endif
  106. #ifndef _AFX_NO_DB_SUPPORT
  107.     #include "afxdb.h"
  108. #endif
  109. #ifndef _AFX_NO_SYNC_SUPPORT
  110.     #include "afxmt.h"
  111. #endif
  112. #ifndef _AFX_NO_INET_SUPPORT
  113.     #include "afxinet.h"
  114. #endif
  115.  
  116. // private headers as well
  117. #include "afxpriv.h"
  118. #include "afximpl.h"
  119. #include "winhand_.h"
  120. #ifndef _AFX_NO_OLE_SUPPORT
  121.     #include "oleimpl2.h"
  122. #endif
  123. #ifndef _AFX_NO_OCX_SUPPORT
  124.     #include "ctlimpl.h"
  125. #endif
  126. #ifndef _AFX_NO_DB_SUPPORT
  127.     #include "dbimpl.h"
  128. #endif
  129. #ifndef _AFX_NO_DAO_SUPPORT
  130.     #include "daoimpl.h"
  131. #endif
  132. #ifndef _AFX_NO_SOCKET_SUPPORT
  133.     #ifndef _WINSOCKAPI_
  134.         #include <winsock.h>
  135.     #endif
  136.     #include "sockimpl.h"
  137.     #include "afxsock.h"
  138. #endif
  139. #ifndef _AFX_NO_AFXCMN_SUPPORT
  140.     #include "commimpl.h"
  141.     #include "afxcmn.h"
  142.     #include "afxcview.h"
  143. #endif
  144. #ifndef _AFX_NO_RICHEDIT_SUPPORT
  145.     #include "afxrich.h"
  146. #endif
  147.  
  148. #include <winreg.h>
  149. #include <winnls.h>
  150. #include <stddef.h>
  151. #include <limits.h>
  152. #include <malloc.h>
  153. #include <new.h>
  154. #ifndef _AFX_OLD_EXCEPTIONS
  155. #include <eh.h>     // for set_terminate
  156. #endif
  157.  
  158. #undef AfxWndProc
  159.  
  160. // implementation uses _AFX_PACKING as well
  161. #ifdef _AFX_PACKING
  162. #ifndef ALL_WARNINGS
  163. #pragma warning(disable: 4103)
  164. #endif
  165. #pragma pack(_AFX_PACKING)
  166. #endif
  167.  
  168. // special exception handling just for MFC library implementation
  169. #ifndef _AFX_OLD_EXCEPTIONS
  170.  
  171. // MFC does not rely on auto-delete semantics of the TRY..CATCH macros,
  172. //  therefore those macros are mapped to something closer to the native
  173. //  C++ exception handling mechanism when building MFC itself.
  174.  
  175. #undef TRY
  176. #define TRY { try {
  177.  
  178. #undef CATCH
  179. #define CATCH(class, e) } catch (class* e) \
  180.     { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  181.  
  182. #undef AND_CATCH
  183. #define AND_CATCH(class, e) } catch (class* e) \
  184.     { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  185.  
  186. #undef CATCH_ALL
  187. #define CATCH_ALL(e) } catch (CException* e) \
  188.     { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  189.  
  190. #undef AND_CATCH_ALL
  191. #define AND_CATCH_ALL(e) } catch (CException* e) \
  192.     { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  193.  
  194. #undef END_TRY
  195. #define END_TRY } catch (CException* e) \
  196.     { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); e->Delete(); } }
  197.  
  198. #undef THROW_LAST
  199. #define THROW_LAST() throw
  200.  
  201. // Because of the above definitions of TRY...CATCH it is necessary to
  202. //  explicitly delete exception objects at the catch site.
  203.  
  204. #define DELETE_EXCEPTION(e) do { e->Delete(); } while (0)
  205. #define NO_CPP_EXCEPTION(expr)
  206.  
  207. #else   //!_AFX_OLD_EXCEPTIONS
  208.  
  209. // In this case, the TRY..CATCH macros provide auto-delete semantics, so
  210. //  it is not necessary to explicitly delete exception objects at the catch site.
  211.  
  212. #define DELETE_EXCEPTION(e)
  213. #define NO_CPP_EXCEPTION(expr) expr
  214.  
  215. #endif  //_AFX_OLD_EXCEPTIONS
  216.  
  217. /////////////////////////////////////////////////////////////////////////////
  218.