SDC C-Project CF Review 프로그램
kojingeun
2023-06-07 b4a18bfef6cb9f5d48a12b455dfa78f9ef67e348
ReviewSystem/ReviewSystem/DisplayMessage.h
@@ -2,6 +2,8 @@
#include "CHEdgeTriangle/Singleton.h"
#define WM_DIPLAY_LOG          WM_USER + 1000
interface IDisplayMessage2Parent
{
public:
@@ -9,8 +11,16 @@
   virtual void   DM2P_DisplayMessage(const TCHAR* lpstrFormat, ...) = 0;
};
class CDisplayMessage : public Singleton<CDisplayMessage>
{
   /*< SWK 20221226 - #4403 ADD Start >*/
   typedef struct _Log_Data
   {
      SYSTEMTIME   currentTime;
      CString      strLog;
   }LogData, *pLogData;
   /*< SWK 20221226 - #4403 ADD End >*/
public:
   CDisplayMessage(const CString& strPath);
   virtual ~CDisplayMessage(void);
@@ -18,18 +28,26 @@
public:
   void   SetDM2P(IDisplayMessage2Parent* pDM2P)      { m_pDM2P = pDM2P; }
   void   SetPath(const CString& strPath);
   BOOL   MakeLogFile();
   BOOL   WriteToFile(const CString& strMessage);
   void   DisplayMessage(const CString& strMessage);
   void   DisplayMessage(const TCHAR* lpstrFormat, ...);
   //< SWK 20221226 - #4403 MOD >
//   void   ThreadDisplayMessage(const CString & strMessage);
   void   ThreadDisplayMessage(const LogData& logdata);
protected:
   BOOL   MakeLogFile();
   //< SWK 20221226 - #4403 MOD >
//   BOOL   WriteToFile(const CString& strMessage);
   BOOL   WriteToFile(const SYSTEMTIME& time, const CString& strMessage);
public:
   static DWORD   RunThreadDisplayLog(LPVOID param);
private:
   CTime                  m_TimeLogFile;
   CFile*                  m_pFileLog;
   CString                  m_strLogPath;
   CString                  m_strLogFile;
   IDisplayMessage2Parent*      m_pDM2P;
   CRITICAL_SECTION         m_csLog;
   DWORD                  m_ThreadId;
};
#define g_pLog   CDisplayMessage::GetSingletonPtr()