home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / addins / autobld / stdafx.h < prev    next >
C/C++ Source or Header  |  1998-04-02  |  3KB  |  78 lines

  1. // stdafx.h : include file for standard system include files,
  2. //  or project specific include files that are used frequently, but
  3. //      are changed infrequently
  4. //
  5.  
  6. // Copyright (C) 1992-1998 Microsoft Corporation
  7. // All rights reserved.
  8.  
  9. #if !defined(AFX_STDAFX_H__D93F3A0F_3DA9_11D0_B889_00C04FD7A0F0__INCLUDED_)
  10. #define AFX_STDAFX_H__D93F3A0F_3DA9_11D0_B889_00C04FD7A0F0__INCLUDED_
  11.  
  12. #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
  13.  
  14. #include <afxwin.h>         // MFC core and standard components
  15. #include <afxdisp.h>
  16. #include <afxcmn.h>
  17. #include <afxdlgs.h>
  18. #include <afxext.h>
  19. #include <atlbase.h>
  20. //You may derive a class from CComModule and use it if you want to override
  21. //something, but do not change the name of _Module
  22. extern CComModule _Module;
  23. #include <atlcom.h>
  24.  
  25. // Developer Studio Object Model
  26. #include <ObjModel\addauto.h>
  27. #include <ObjModel\appdefs.h>
  28. #include <ObjModel\appauto.h>
  29. #include <ObjModel\blddefs.h>
  30. #include <ObjModel\bldauto.h>
  31. #include <ObjModel\textdefs.h>
  32. #include <ObjModel\textauto.h>
  33. #include <ObjModel\dbgdefs.h>
  34. #include <ObjModel\dbgauto.h>
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // Debugging support
  38.  
  39. // Use VERIFY_OK around all calls to the Developer Studio objects which
  40. //  you expect to return S_OK.
  41. // In DEBUG builds of your add-in, VERIFY_OK displays an ASSERT dialog box
  42. //  if the expression returns an HRESULT other than S_OK.  If the HRESULT
  43. //  is a success code, the ASSERT box will display that HRESULT.  If it
  44. //  is a failure code, the ASSERT box will display that HRESULT plus the
  45. //  error description string provided by the object which raised the error.
  46. // In RETAIL builds of your add-in, VERIFY_OK just evaluates the expression
  47. //  and ignores the returned HRESULT.
  48.  
  49. #ifdef _DEBUG
  50.  
  51. void GetLastErrorDescription(CComBSTR& bstr);       // Defined in AutoBld.cpp
  52. #define VERIFY_OK(f) \
  53.     { \
  54.         HRESULT hr = (f); \
  55.         if (hr != S_OK) \
  56.         { \
  57.             if (FAILED(hr)) \
  58.             { \
  59.                 CComBSTR bstr; \
  60.                 GetLastErrorDescription(bstr); \
  61.                 _RPTF2(_CRT_ASSERT, "Object call returned %lx\n\n%S", hr, (BSTR) bstr); \
  62.             } \
  63.             else \
  64.                 _RPTF1(_CRT_ASSERT, "Object call returned %lx", hr); \
  65.         } \
  66.     }
  67.  
  68. #else //_DEBUG
  69.  
  70. #define VERIFY_OK(f) (f)
  71.  
  72. #endif //_DEBUG
  73.  
  74. //{{AFX_INSERT_LOCATION}}
  75. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  76.  
  77. #endif // !defined(AFX_STDAFX_H__D93F3A0F_3DA9_11D0_B889_00C04FD7A0F0__INCLUDED)
  78.