#pragma once
#include "afxwin.h"
#include "afxcmn.h"


// CUpDownLoad 对话框

class CUpDownLoad : public CDialog
{
	DECLARE_DYNAMIC(CUpDownLoad)

public:
	CUpDownLoad(CRect rcWnd, CWnd* pParent = NULL);   // 标准构造函数
	virtual ~CUpDownLoad();

// 对话框数据
	enum { IDD = IDD_DLG_UPDOWNLOAD };
	
	void SetSelIP(CString &strIP);

	LONG __stdcall	StatusCallBack(LONG lUser,LONG mlStateCode,char *mpResponse,void *pUser);


public:
	BOOL m_bUpGetVersion;
	char szVersionBuf[256];
	char szBeforeVer[128];
	char szAfterVer[128];
	CDevInfo* m_pDevInfo;
	long m_timeElapse;
	BOOL m_loginOK;
	
	long GetFileVersion(char* szVerBuf, char* outVerBuf);

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()


private:
	BOOL m_bShow;
	CRect m_rcClient;
	virtual BOOL OnInitDialog();
	CStatic m_ctlGroup;
	afx_msg void OnBnClickedBtnUpload();
	afx_msg void OnBnClickedBtnDownload();
	afx_msg void OnBnClickedBtnLaoding();
	CEdit m_ctlEDPath;
	afx_msg void OnBnClickedBtnUpgrade();
	afx_msg void OnBnClickedBtnStop();
	afx_msg void OnBnClickedBtnLoading();
	CStatic m_ctlDevIP;

	BOOL m_bUpgrade;
	CEdit m_ctlFirmWarePath;
	CProgressCtrl m_ctlUpgradeProcess;
	afx_msg void OnTimer(UINT_PTR nIDEvent);

	int m_iUserID;
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnBnClickedBtnReboot();
	afx_msg void OnBnClickedBtnFactoryset();
	afx_msg HRESULT OnStatusEvent(WPARAM, LPARAM);
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
};
