stdafx.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // MFC inline constructors (including compiler generated) can get deep
  13. #pragma inline_depth(16)
  14. // core headers
  15. #include "afx.h"
  16. // public headers
  17. #include "afxres.h"
  18. inline HINSTANCE AFXAPI AfxGetResourceHandle()
  19. { ASSERT(afxCurrentResourceHandle != NULL);
  20. return afxCurrentResourceHandle; }
  21. int AFXAPI AfxLoadString(UINT nIDS, LPTSTR lpszBuf, UINT nMaxBuf = 256);
  22. #define _countof(array) (sizeof(array)/sizeof(array[0]))
  23. BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn);
  24. #include <stddef.h>
  25. #include <limits.h>
  26. #include <malloc.h>
  27. #include <new.h>
  28. // MFC does not rely on auto-delete semantics of the TRY..CATCH macros,
  29. // therefore those macros are mapped to something closer to the native
  30. // C++ exception handling mechanism when building MFC itself.
  31. #undef TRY
  32. #define TRY { try {
  33. #undef CATCH
  34. #define CATCH(class, e) } catch (class* e) \
  35. { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  36. #undef AND_CATCH
  37. #define AND_CATCH(class, e) } catch (class* e) \
  38. { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
  39. #undef CATCH_ALL
  40. #define CATCH_ALL(e) } catch (CException* e) \
  41. { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  42. #undef AND_CATCH_ALL
  43. #define AND_CATCH_ALL(e) } catch (CException* e) \
  44. { { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
  45. #undef END_TRY
  46. #define END_TRY } catch (CException* e) \
  47. { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); e->Delete(); } }
  48. #undef THROW_LAST
  49. #define THROW_LAST() throw
  50. // Because of the above definitions of TRY...CATCH it is necessary to
  51. // explicitly delete exception objects at the catch site.
  52. /////////////////////////////////////////////////////////////////////////////