TThreadPollingF.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //---------------------------------------------------------------------------
  2. #ifndef TThreadPollingFH
  3. #define TThreadPollingFH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <ADODB.hpp>
  10. #include <DB.hpp>
  11. //---------------------------------------------------------------------------
  12. class TThreadPolling : public TThread
  13. {
  14. protected:
  15. void __fastcall Execute();
  16. private:
  17. TADOConnection *m_pConnection;
  18. HWND m_lMainWinHandle;
  19. String m_sDbConnString;
  20. bool __fastcall DbConnect();
  21. bool __fastcall IsDbOpen()
  22. {
  23. if (m_pConnection) return m_pConnection->Connected;
  24. else return false;
  25. };
  26. void __fastcall DbClose()
  27. {
  28. if (IsDbOpen()) m_pConnection->Close();
  29. };
  30. bool __fastcall IsDbDisconnected();
  31. public:
  32. __fastcall TThreadPolling(bool CreateSuspended);
  33. __fastcall ~TThreadPolling();
  34. public:
  35. bool __fastcall SelProcessStatusData(LPARAM LParam);
  36. bool __fastcall SelVmsStatusData(LPARAM LParam);
  37. bool __fastcall SelVmsMsg(LPARAM LParam);
  38. bool __fastcall SelIfscTrafficData(LPARAM LParam);
  39. bool __fastcall SelVmsIfscTrafficData(LPARAM LParam);
  40. bool __fastcall SelIncidentData(LPARAM LParam);
  41. };
  42. //---------------------------------------------------------------------------
  43. #endif