SDC C-Project CF Review 프로그램
LYW
2021-06-07 b785acb6a38b295544c03f83caccf99368d1b598
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
 
// FTPUploaderDlg.h : header file
//
 
#pragma once
#include "afxcmn.h"
#include "ListCtrlEx.h"
#include "FTPThreadPool.h"
#include "DlgUploadList.h"
 
#include <fstream>
#include "afxwin.h"
#include "TrayIcon.h"
 
#include "akFileDB.h"
 
#define UM_FTP_LOG                (WM_USER + 100)
#define UM_FTP_LOG_UP            (WM_USER + 101)
#define UM_FTP_NOTIFY_LOG        (WM_USER + 102)
#define UM_FTP_NOTIFY_LOG_UP    (WM_USER + 103)
#define UM_FTP_UPDATE_LIST        (WM_USER + 104)
#define UM_FTP_UPDATE_LIST_UP    (WM_USER + 105)
 
#define TIMER_BLANK_UPDOWNLOAD    (WM_USER + 110)
#define TIMER_SAVE_LOG_FILE        (WM_USER + 111)
#define TIMER_FTP_UPLOAD_INFO    (WM_USER + 112)
 
#define SHCU                    HKEY_CURRENT_USER
#define    KEY_FTP                    _T("Software\\DIT\\FTP\\")        // ·¹Áö½ºÆ®¸® Á¢±Ù °æ·Î¼³Á¤
#define CONFIGFILENAME            _T("FTPUploader.cfg")
 
#define FTP_LOG_FILE_PATH        _T("C:\\DIT_LogData\\")
#define FTP_LOG_FILE_NAME        _T("logFTPUploader")
#define BLANK_UPDOWNLOAD_PATH    _T("c:\\Temp")
#define BLANK_DOWNLOAD_FILE        _T("!!!H_GLASS_ID_DOWN.IDX")
#define BLANK_UPLOAD_FILE        _T("!!!H_GLASS_ID_UP.IDX")
 
enum emConfigMode
{
    CM_Register = 0,
    CM_File
};
 
#include <vector>
#include <list>
typedef std::vector<CString>                        VecString;
typedef std::vector<CString>::iterator                VecStringIt;
typedef std::vector<CString>::const_iterator        constVecStringIt;
 
 
// CFTPUploaderDlg dialog
class CFTPUploaderDlg : public CDialog, 
                        public IFTPThreadPool2Parent,
                        public IDlgUploadList2Parent
{
// Construction
public:
    CFTPUploaderDlg(CWnd* pParent = NULL);    // standard constructor
    virtual ~CFTPUploaderDlg();
 
// Dialog Data
    enum { IDD = IDD_FTPUPLOADER_DIALOG };
 
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
 
// Implementation
protected:
    HICON m_hIcon;
 
    void AddDownload(const CFTPCopyDataParam* pParam);
    void AddUpload(const CFTPCopyDataParam* pParam);
 
    BOOL LoadConfig();
 
    // Generated message map functions
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg void OnDestroy();
    afx_msg HCURSOR OnQueryDragIcon();
    DECLARE_MESSAGE_MAP()
 
protected:
    CRect                m_rtOgrWindow;
    CRect                m_rtAddWindow;
 
    VecString            m_vecFTPLog;
    VecString            m_vecFTPFailLog;
 
 
    CListBox            m_ctlLogList;
    CListBox            m_ctlLogList_Up;
 
    CIPAddressCtrl        m_ctlIPAddress;
    CString                m_strID;
    CString                m_strPW;
    int                    m_nTimeOut;
    CString                m_strHomePath;
    int                    m_nPort;    
    CButton                m_ctrlPassiveMode;
    BOOL                m_bCheckAutoUpload;
    int                    m_nAutoUploadDelay;
    BOOL                m_bPassiveMode;
 
    BOOL                m_bWSIChk;
 
    CIPAddressCtrl        m_ctlIPAddress2;
    CString                m_strID2;
    CString                m_strPW2;
    int                    m_nTimeOut2;
    CString                m_strHomePath2;
    int                    m_nPort2;
 
    //201218 CJH - IP Ãß°¡
    CIPAddressCtrl        m_ctlIPAddress3;
    CString                m_strID3;
    CString                m_strPW3;
    int                    m_nTimeOut3;
    CString                m_strHomePath3;
    int                    m_nPort3;
 
    CFTPThreadPool*        m_pFTPThreadPool_Down;
    CFTPThreadPool*        m_pFTPThreadPool_Up;
    CDlgUploadList*        m_pDlgUploadList_Down;
    CDlgUploadList*        m_pDlgUploadList_Up;
 
    CCriticalSection    m_csFTPLog;
    CTrayIcon            m_TrayIcon;
 
    emConfigMode        m_nConfigMode;
    CakFileDB            m_fileConfig;
protected:
    virtual void IFTP2P_DisplayLogMessage(int nType, int nLogIndex);
    virtual void IFTP2P_DisplayNotifyMessage(int nType, int nNotifyType, int nLogIndex);
    virtual BOOL IDUL2P_GetReadyUploadParam(int nType, DeqFTPUploadParam& deqUploadParam);
 
    BOOL    ReadString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, LPBYTE lpRet, DWORD nSize);
    BOOL    WriteString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, LPSTR lpData);    
 
    void    Process_BlankFileCreate();
    void    Process_BlankUpDownload();
    void    Process_SaveFTPLog();    
    void    Process_FtpUploaderInfo();
    BOOL    CreatePathDir(const CString& strFilename);
 
public:
    afx_msg LRESULT OnFTPLog(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnFTPLog_Up(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnFTPNotifyLog(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnFTPNotifyLog_Up(WPARAM wParam, LPARAM lParam);
    
    afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam);
 
    afx_msg void OnClose();
    afx_msg void OnFileOpen();
    afx_msg void OnFileClose();
 
    afx_msg void OnBnClickedButtonTest();
    afx_msg void OnBnClickedButtonConfigSave();
    afx_msg void OnBnClickedCheckAutoUpload();
    afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnBnClickedButtonDownloadList();
    afx_msg void OnBnClickedButtonUploadList();
    virtual BOOL DestroyWindow();
    CButton m_chkWSI;
};