home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / SOFT / SqlEval7 / MSOLAP / samples / Samples.exe / CppOlapDemo / OLAPApp.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-30  |  2.4 KB  |  70 lines

  1. //-----------------------------------------------------------------------------
  2. // Microsoft OLE DB QLAPDEMO Sample
  3. // Copyright (C) 1995-1998 Microsoft Corporation
  4. //
  5. // File: OLAPApp.hpp
  6. //
  7. // This file defines the class OLAPApp which is basic class for
  8. // OLAP Application. It defines basic functionality of generic
  9. // OLAP Application.
  10. //-----------------------------------------------------------------------------
  11.  
  12. #ifndef OLAPApp_hpp                 // Protection for multiple #includes
  13. #define OLAPApp_hpp
  14.  
  15. #ifndef RC_INVOKED
  16. #pragma message ("Including OLAPApp.hpp from " __FILE__)
  17. #endif
  18.  
  19. // Application states used by OLAPApp
  20. const DWORD OLAP_APP_INITIALIZED    = 0x00000001;
  21. const DWORD OLAP_APP_CONNECTED      = 0x00000002;
  22. const DWORD OLAP_APP_DB_OPEN        = 0x00000004;
  23. const DWORD OLAP_APP_QUERY_EXECUTED = 0x00000008;
  24.  
  25. //////////////////////////////////////////////////////////////////////////////////////
  26. class OLAPApp
  27.  
  28. // The OLAP application class
  29. //////////////////////////////////////////////////////////////////////////////////////
  30. {
  31. private:
  32.  
  33.     DWORD                m_dwState;                // Current application state.
  34.  
  35.     IDBCreateSession*   m_pIDBSource;           // Source interface
  36.     IDBCreateCommand*   m_pIDBSession;          // Session interface
  37.  
  38.     ICommandText*       m_pICommand;            // Command for query execution
  39.     IMDDataset*         m_pIMDDataset;          // Query result
  40.  
  41. protected:
  42.  
  43. public:
  44.  
  45.                    OLAPApp();
  46.         virtual    ~OLAPApp();
  47.  
  48.         inline    DWORD                StateOn( DWORD  state ) { return (m_dwState |= state);  }
  49.         inline    DWORD                StateOff( DWORD state ) { return (m_dwState &= ~state); }
  50.  
  51.         inline  BOOL                IsState( DWORD state )  { return (m_dwState & state) == state; }
  52.  
  53.         inline  IDBCreateSession*   GetSource()  { return m_pIDBSource;  }
  54.         inline  IDBCreateCommand*   GetSession() { return m_pIDBSession; }
  55.         inline  IMDDataset*         GetDataset() { return m_pIMDDataset; }
  56.         
  57.         virtual    HRESULT                Init();
  58.         virtual    HRESULT                Reset();
  59.  
  60.                 HRESULT             GetProperty( GUID  propSet, DBPROPID  propId, VARIANT*  pData );
  61.  
  62.         virtual    HRESULT                Connect( LPTSTR  pServer = NULL );
  63.         virtual    HRESULT                Disconnect();
  64.  
  65.         virtual    HRESULT                OpenDataBase( LPTSTR  pDataBase = NULL );
  66.         virtual    HRESULT                ExecQuery( LPTSTR  pQuery );
  67. };
  68.  
  69. #endif
  70.