home *** CD-ROM | disk | FTP | other *** search
- //-----------------------------------------------------------------------------
- // Microsoft OLE DB QLAPDEMO Sample
- // Copyright (C) 1995-1998 Microsoft Corporation
- //
- // File: OLAPApp.hpp
- //
- // This file defines the class OLAPApp which is basic class for
- // OLAP Application. It defines basic functionality of generic
- // OLAP Application.
- //-----------------------------------------------------------------------------
-
- #ifndef OLAPApp_hpp // Protection for multiple #includes
- #define OLAPApp_hpp
-
- #ifndef RC_INVOKED
- #pragma message ("Including OLAPApp.hpp from " __FILE__)
- #endif
-
- // Application states used by OLAPApp
- const DWORD OLAP_APP_INITIALIZED = 0x00000001;
- const DWORD OLAP_APP_CONNECTED = 0x00000002;
- const DWORD OLAP_APP_DB_OPEN = 0x00000004;
- const DWORD OLAP_APP_QUERY_EXECUTED = 0x00000008;
-
- //////////////////////////////////////////////////////////////////////////////////////
- class OLAPApp
-
- // The OLAP application class
- //////////////////////////////////////////////////////////////////////////////////////
- {
- private:
-
- DWORD m_dwState; // Current application state.
-
- IDBCreateSession* m_pIDBSource; // Source interface
- IDBCreateCommand* m_pIDBSession; // Session interface
-
- ICommandText* m_pICommand; // Command for query execution
- IMDDataset* m_pIMDDataset; // Query result
-
- protected:
-
- public:
-
- OLAPApp();
- virtual ~OLAPApp();
-
- inline DWORD StateOn( DWORD state ) { return (m_dwState |= state); }
- inline DWORD StateOff( DWORD state ) { return (m_dwState &= ~state); }
-
- inline BOOL IsState( DWORD state ) { return (m_dwState & state) == state; }
-
- inline IDBCreateSession* GetSource() { return m_pIDBSource; }
- inline IDBCreateCommand* GetSession() { return m_pIDBSession; }
- inline IMDDataset* GetDataset() { return m_pIMDDataset; }
-
- virtual HRESULT Init();
- virtual HRESULT Reset();
-
- HRESULT GetProperty( GUID propSet, DBPROPID propId, VARIANT* pData );
-
- virtual HRESULT Connect( LPTSTR pServer = NULL );
- virtual HRESULT Disconnect();
-
- virtual HRESULT OpenDataBase( LPTSTR pDataBase = NULL );
- virtual HRESULT ExecQuery( LPTSTR pQuery );
- };
-
- #endif
-