// MastersProjectDlg.h : header file // #if !defined(AFX_MASTERSPROJECTDLG_H__F75D4AB6_D232_11D4_B235_00A0C977BE58__INCLUDED_) #define AFX_MASTERSPROJECTDLG_H__F75D4AB6_D232_11D4_B235_00A0C977BE58__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include #include #include "mtqueue.h" typedef struct tagITEMINFO { CString strFileName; DWORD nFileSizeLow; FILETIME ftLastWriteTime; } ITEMINFO; ///////////////////////////////////////////////////////////////////////////// // CMastersProjectDlg dialog class CMastersProjectDlg : public CDialog { // Construction public: void enableAll(BOOL show = TRUE); void setProgressPos(int nPos); void setProgressRange(int nLower, int nUpper); std::string getServerPath(); void sendFileToClient(); std::string getXMLDirStruct(std::string fileName); void deleteClientList(); std::string getFileName(); HANDLE& getHandle(int i); HANDLE& getFileHandle(); HANDLE getHandle(int i) const; void enQListener(std::string XMLString); std::string deQListener(); void enQSender(std::string XMLString); std::string deQSender(); int lenQSender(); int lenQListener(); bool connectToServer(); int RefreshServer (LPCTSTR pszPath); BOOL AddItemServer(int nIndex, WIN32_FIND_DATA *pfd); BOOL AddItemClient(int nIndex, WIN32_FIND_DATA *pfd); CMastersProjectDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CMastersProjectDlg) enum { IDD = IDD_MASTERSPROJECT_DIALOG }; CButton m_exitButton; CButton m_connectButton; CProgressCtrl m_transferProgress; CButton m_receiveButton; CButton m_sendButton; CListCtrl m_listFilesClient; CListCtrl m_listFilesServer; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMastersProjectDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation public: // Generated message map functions //{{AFX_MSG(CMastersProjectDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnGetdispinfoListFilesServer(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDblclkListFilesServer(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnClickListFilesServer(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnButtonSend(); afx_msg void OnButtonConnect(); afx_msg void OnGetdispinfoListFilesClient(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDblclkListFilesClient(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnButtonReceive(); afx_msg void OnClickListFilesClient(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDestroy(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: HICON m_hIcon; CImageList m_ilSmall; CBitmap m_bmpSmallFolder; CString m_strPathServer; CString m_strPathClient; CString m_fileName; HANDLE th[6]; HANDLE fileHandle; mtqueue listenerQ; mtqueue senderQ; }; inline HANDLE& CMastersProjectDlg::getFileHandle() { return fileHandle; } inline std::string CMastersProjectDlg::getServerPath() { return std::string (m_strPathServer); } inline std::string CMastersProjectDlg::getFileName() { return std::string(m_fileName); } inline HANDLE& CMastersProjectDlg::getHandle(int i) { return th[i]; } inline HANDLE CMastersProjectDlg::getHandle(int i) const { return th[i]; } inline void CMastersProjectDlg::enQListener(std::string XMLString) { listenerQ.enQ(XMLString); } inline std::string CMastersProjectDlg::deQListener() { return listenerQ.deQ(); } inline void CMastersProjectDlg::enQSender(std::string XMLString) { senderQ.enQ(XMLString); } inline std::string CMastersProjectDlg::deQSender() { return senderQ.deQ(); } inline int CMastersProjectDlg::lenQSender() { return senderQ.length(); } inline int CMastersProjectDlg::lenQListener() { return listenerQ.length(); } void _cdecl startServer(void* pArgs); void _cdecl serverListener(void* pArgs); void _cdecl sendFile(void* pArgs); void _cdecl deQSenderTh(void* pArgs); void _cdecl enQListenerTh(void* pArgs); void _cdecl deQListenerTh(void* pArgs); //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MASTERSPROJECTDLG_H__F75D4AB6_D232_11D4_B235_00A0C977BE58__INCLUDED_)