SDC C-Project CF Review 프로그램
LYW
2022-04-21 75c1317438374ab8555e85b491b36113b5aeb9c7
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
#pragma once
 
// CLogListBox
#define STRINGBUFFER_COUNT        200
 
class AFX_EXT_CLASS CLogListBox : 
    public CListBox
{
    DECLARE_DYNAMIC(CLogListBox)
 
public:
    CLogListBox();
    virtual ~CLogListBox();
 
    void SetPath(CString strPath, CString strName);
    void DisplayMessage(BOOL bAddMsgBox, const CString& str);
    void DisplayMessage(BOOL bAddMsgBox, const TCHAR* lpstrMacroFormat, ...);
 
private:
    BOOL                MakeLogFile();
    BOOL                WriteToFile(const CTime& time, CString strContents);
 
    CString                m_strLogPath;
    CString                m_strLogFile;
    CTime                m_TimeLogFile;
    CFile*                m_pFileLog;
 
    DWORD                m_dwThreadID;
    CString                m_strArray[STRINGBUFFER_COUNT];
    BOOL                m_bMustDisplay[STRINGBUFFER_COUNT];
    int                    m_nAddIndex;
    int                    m_nReadIndex;
 
    CRITICAL_SECTION    m_csLog;
 
protected:
    afx_msg LRESULT OnDisplayMessage(WPARAM wParam, LPARAM lParam);
    DECLARE_MESSAGE_MAP()
public:
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};