StkReceiver.h
上传用户:zhanglf88
上传日期:2013-11-19
资源大小:6036k
文件大小:3k
源码类别:

金融证券系统

开发平台:

Visual C++

  1. #pragma once
  2. #define WM_APP_STKRECEIVER_CONNECTSERVER WM_APP+1
  3. #define WM_APP_STKRECEIVER_DISCONNECTSERVER WM_APP+2
  4. #define WM_APP_STKRECEIVER_INIT WM_APP+3
  5. #define WM_APP_STKRECEIVER_SETUP WM_APP+4
  6. #define WM_APP_STKRECEIVER_QUIT WM_APP+5
  7. #define WM_APP_STKRECEIVER_DATA WM_APP+6
  8. #define WM_APP_STKRECEIVER_ALARM WM_APP+7
  9. #define WM_APP_STKRECEIVER_TSDATA WM_APP+8 // 通视接收消息
  10. #define STKRCV_ALARM_REFRESH 1
  11. #define STKRCV_ALARM_WARNING 2
  12. class CStkReceiver;
  13. STKNET_API CStkReceiver & AfxGetStkReceiver();
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CStkReceiver window
  16. struct COMM_PACKET;
  17. class STKNET_API CStkReceiver : public CWnd
  18. {
  19. // Construction
  20. public:
  21. CStkReceiver();
  22. virtual ~CStkReceiver();
  23. protected:
  24. // 公共数据
  25. CArray<HWND,HWND> m_awndRcvData;
  26. CArray<HWND,HWND> m_awndRcvAlarm;
  27. // 通视卡使用数据
  28. BOOL m_bTongshiRunning;
  29. public:
  30. static HANDLE m_hEventKillProcessThread;
  31. static HANDLE m_hEventProcessThreadKilled;
  32. // Attributes
  33. public:
  34. BOOL CreateReceiver(CWnd * pParentWnd);
  35. void OnReceiveReport(REPORT * pReport);
  36. void AddRcvAlarmWnd(HWND hWnd);
  37. BOOL RemoveRcvAlarmWnd(HWND hWnd);
  38. void NotifyWndRcvAlarm(WPARAM wParam, LPARAM lParam);
  39. void AddRcvDataWnd(HWND hWnd);
  40. BOOL RemoveRcvDataWnd(HWND hWnd);
  41. void NotifyWndRcvData(WPARAM wParam, LPARAM lParam);
  42. // 网络接收引擎
  43. BOOL NetEngineBeginWorking();
  44. BOOL NetEngineBeginWorking(LPCTSTR lpszAddress, UINT nPort, LPCTSTR lpszUser, LPCTSTR lpszPasswd);
  45. BOOL NetEngineEndWorking();
  46. BOOL NetEngineIsWorking();
  47. int NetEngineSetAutoReport(int bAutoReport);
  48. int RequestStockData(int nDataType/*CStock::DataType*/, CStockInfo * pStockInfo, int nSize, int nKType, int nDataCount);
  49. int RequestKData(CStock *pstock, int period);
  50. // 通视卡方法
  51. BOOL EngineBeginWorking(BOOL bShowSelectEngineDialog);
  52. BOOL EngineSetup();
  53. BOOL EngineEndWorking();
  54. BOOL EngineIsWorking();
  55. int RefreshStockContainer(CStockContainer & container, BOOL bAddIfNotExist);
  56. int GetReport(CStockInfo &info, CReport &aReport);
  57. protected:
  58. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  59. afx_msg void OnDestroy();
  60. afx_msg LRESULT OnStkReceiverConnectserver(WPARAM wParam, LPARAM lParam);
  61. afx_msg LRESULT OnStkReceiverDisconnectserver(WPARAM wParam, LPARAM lParam);
  62. afx_msg LRESULT OnStkReceiverInit(WPARAM wParam, LPARAM lParam);
  63. afx_msg LRESULT OnStkReceiverSetup(WPARAM wParam, LPARAM lParam);
  64. afx_msg LRESULT OnStkReceiverQuit(WPARAM wParam, LPARAM lParam);
  65. afx_msg LRESULT OnStkReceiverTsdata(UINT wFileType,LONG lPara);
  66. DECLARE_MESSAGE_MAP()
  67. };