#pragma once
|
|
#include "CHEdgeTriangle/Singleton.h"
|
|
#define WM_DIPLAY_LOG WM_USER + 1000
|
|
interface IDisplayMessage2Parent
|
{
|
public:
|
virtual void DM2P_DisplayMessage(const CString& strMessage) = 0;
|
virtual void DM2P_DisplayMessage(const TCHAR* lpstrFormat, ...) = 0;
|
};
|
|
DWORD RunThreadDisplayLog(LPVOID param);
|
|
class CDisplayMessage : public Singleton<CDisplayMessage>
|
{
|
public:
|
CDisplayMessage(const CString& strPath);
|
virtual ~CDisplayMessage(void);
|
|
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, ...);
|
void ThreadDisplayMessage(const CString & strMessage);
|
|
public:
|
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()
|