www.pudn.com > DSPSample.rar > FileSendDlg.h


#if !defined(AFX_FILESENDDLG_H__80926EF3_5EB5_4129_8677_9F94D157427A__INCLUDED_) 
#define AFX_FILESENDDLG_H__80926EF3_5EB5_4129_8677_9F94D157427A__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// FileSendDlg.h : header file 
// 
 
///////////////////////////////////////////////////////////////////////////// 
// FileSendDlg dialog 
#define LISTENPORT	34567 
 
#include "Resource.h" 
#include "DSPSpider.h" 
class SpiderWnd; 
 
class FileSendDlg : public CDialog 
{ 
// Construction 
public: 
	FileSendDlg(CWnd* pParent = NULL);   // standard constructor 
	~FileSendDlg() 
	{ 
		if(m_sockConnect!=INVALID_SOCKET) 
			::closesocket(m_sockConnect); 
		if(m_phListenThreadParam!=NULL) 
		{ 
			SOCKET sock	=m_phListenThreadParam->sock; 
			m_phListenThreadParam->sock	=INVALID_SOCKET; 
			::closesocket(sock); 
			delete m_phListenThreadParam; 
		} 
	}; 
 
// Dialog Data 
	//{{AFX_DATA(FileSendDlg) 
	enum { IDD = IDD_DLG_FILETRANSMITTAL }; 
	CStatic	m_strFilesize; 
	CStatic	m_strFilename; 
	CStatic	m_strCurrLen; 
	CProgressCtrl	m_progress; 
	CComboBox	m_comboIP; 
	CButton	m_checkNet; 
	CButton	m_checkCrc; 
	CButton	m_btnSend; 
	CButton	m_btnListen; 
	CButton	m_btnConnect; 
	CButton	m_btnClose; 
	//}}AFX_DATA 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(FileSendDlg) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	bool							m_bRun; 
	bool							m_bSendType; 
	SOCKET							m_sockConnect; 
	DSPSpider::_SENDTHREADPARAM*	m_phListenThreadParam; 
 
	static	UINT	SendFileThread(LPVOID lpDlg); 
	static	bool	ListenProcessFunc(DSPSpider::_SENDTHREADPARAM *phParam,DSP::_DSPPACKET& packet); 
 
	LRESULT OnSendComplete(WPARAM wParam, LPARAM lParam); 
	LRESULT OnRecvSect(WPARAM wParam, LPARAM lParam); 
	LRESULT OnSendSect(WPARAM wParam, LPARAM lParam); 
	LRESULT OnSetFilenameSize(WPARAM wParam, LPARAM lParam); 
 
	LRESULT OnGetFilename(WPARAM wParam, LPARAM lParam); 
 
	// Generated message map functions 
	//{{AFX_MSG(FileSendDlg) 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnBtnclose(); 
	afx_msg void OnBtnconnect(); 
	afx_msg void OnBtnlisten(); 
	afx_msg void OnBtnsend(); 
	afx_msg void OnBtnspiderrecv(); 
	afx_msg void OnBtnjoin(); 
	afx_msg void OnBtnhelp(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_FILESENDDLG_H__80926EF3_5EB5_4129_8677_9F94D157427A__INCLUDED_)