home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / fwcommon.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.5 KB  |  89 lines

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. //***************************************************************************
  3. //
  4. //  Copyright (c) 1996-1999 Microsoft Corporation
  5. //
  6. //  FWcommon.h
  7. //
  8. //  Purpose: Definition of EventProvider class
  9. //
  10. //***************************************************************************
  11.  
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15.  
  16. // ALWAYS INCLUDE THIS FILE FIRST!
  17.  
  18. #ifndef _FW_COMMON_H_
  19. #define _FW_COMMON_H_
  20.  
  21. // move warnings to level four
  22. #pragma warning(4 : 4275 4800 4786 4251)
  23. //    C4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
  24. //    C4800: forcing bool variable to one or zero, possible performance loss
  25. //    C4786: 'identifier' : identifier was truncated to 'number' characters in the debug information
  26. //    C4251: 'identifier' : class 'type' needs to have dll-interface to export class 'type2'
  27.  
  28.  
  29. #define _WIN32_WINNT 0x0400
  30. #include "windows.h"
  31.  
  32. // This function gets macro'ed to GetObjectW and GetObjectA based on the
  33. // contents of UNICODE.  However, we USE a function called GetObject.  For
  34. // single binary support, we can't have this being macro'ed.  If the actual
  35. // win32 api GetObject is needed, call the GetObjectW or GetObjectA directly.
  36. #undef GetObject
  37. #include <wbemidl.h>
  38.  
  39. // If USE_POLARITY not defined, some Framedyn.dll symbols may not resolve correctly
  40. // It's a declspec(dllimport/dllexport) issue.
  41. #ifndef USE_POLARITY
  42.  
  43. // For most users, this is the correct setting for POLARITY.
  44. #define USE_POLARITY
  45.  
  46. #endif
  47.  
  48. // Required since TCHAR.H defines _ttoi64 -> atoi64, which requires oldnames.lib, which
  49. // we don't use.
  50. #define atoi64 _atoi64
  51.  
  52. #include <Polarity.h>
  53.  
  54. #undef _CRTIMP
  55. #define _CRTIMP POLARITY
  56. #include <yvals.h>
  57. #undef _CRTIMP
  58.  
  59. #include <stllock.h>
  60. extern POLARITY CCritSec g_cs;
  61.  
  62. #include "utillib.h"
  63. #include "ThrdBase.h"
  64. #include "RefPtrCo.h"
  65. #include "MethodCo.h"
  66. #include "FRQuery.h"
  67. #include "wbemglue.h"
  68. #include "instance.h"
  69.  
  70. class CFramework_Exception
  71. {
  72. private:
  73.  
  74.     CHString m_sErrorText;
  75.     HRESULT m_hr;
  76.  
  77. public:
  78.  
  79.     CFramework_Exception ( LPCWSTR lpwszErrorText, HRESULT hr) : m_hr ( hr ) , m_sErrorText ( lpwszErrorText) {}
  80.     CFramework_Exception ( LPCWSTR lpwszErrorText) : m_hr ( WBEM_S_NO_ERROR ) , m_sErrorText ( lpwszErrorText) {}
  81.     ~CFramework_Exception () {}
  82.  
  83.     HRESULT GetHRESULT() { return m_hr ; }
  84.     CHString &GetErrorText() { return m_sErrorText; }
  85. } ;
  86.  
  87. #endif
  88. #pragma option pop /*P_O_Pop*/
  89.