Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cWMI.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cWMI_H
7 #define _INC_cWMI_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cComPtr.h"
14 
15 #if defined(_WIN32) && ! defined(UNDER_CE)
16 
17 interface IEnumWbemClassObject;
18 interface IWbemClassObject;
19 interface IWbemServices;
20 interface IWbemLocator;
21 
22 namespace GrayLib
23 {
24  class cWinVariant;
25  UNITTEST2_PREDEF(cWMI);
26 
27  class GRAYLIB_LINK cWMI
28  {
36 
37  public:
38  cComPtr<IWbemLocator> m_pLocator;
39  cComPtr<IWbemServices> m_pServices;
40 
41  public:
42  cWMI(void);
43  ~cWMI(void);
44 
45  HRESULT Init();
46 
47  UNITTEST_FRIEND(cWMI);
48  };
49 
50  class GRAYLIB_LINK cWMIQuery
51  {
54 
55  public:
56  cComPtr<IEnumWbemClassObject> m_pEnum;
57  cComPtr<IWbemClassObject> m_pObj;
58 
59  public:
60  cWMIQuery();
61  ~cWMIQuery();
62 
63  HRESULT Query(cWMI& loc, const wchar_t* pszSet, const wchar_t* pszQuery);
64  HRESULT Next();
65 
66  HRESULT Get(const wchar_t* pszName, OUT cWinVariant& v);
67  };
68 }
69 
70 #endif
71 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cMesh.h:22
UNITTEST2_PREDEF(cQuadtree)