123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //---------------------------------------------------------------------------
- #ifndef TThreadPollingFH
- #define TThreadPollingFH
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ADODB.hpp>
- #include <DB.hpp>
- //---------------------------------------------------------------------------
- class TThreadPolling : public TThread
- {
- protected:
- void __fastcall Execute();
- private:
- TADOConnection *m_pConnection;
- HWND m_lMainWinHandle;
- String m_sDbConnString;
- bool __fastcall DbConnect();
- bool __fastcall IsDbOpen()
- {
- if (m_pConnection) return m_pConnection->Connected;
- else return false;
- };
- void __fastcall DbClose()
- {
- if (IsDbOpen()) m_pConnection->Close();
- };
- bool __fastcall IsDbDisconnected();
- public:
- __fastcall TThreadPolling(bool CreateSuspended);
- __fastcall ~TThreadPolling();
- public:
- bool __fastcall SelProcessStatusData(LPARAM LParam);
- bool __fastcall SelCctvStatusData(LPARAM LParam);
- bool __fastcall SelIncidentData(LPARAM LParam);
- };
- //---------------------------------------------------------------------------
- #endif
|